You must Sign In to post a response.
  • Category: .NET

    How to use AntiXSS in VB.net

    I am getting below error on using below code in my vb.net.


    Code :
    <td class="body" ><%=Microsoft.Security.Application.AntiXss.HtmlAttributeEncode(varMethod("TokenNumber"))%> </td>


    Error : Microsoft VBScript runtime error '800a01a8'
    Object required: ''



    Please provide solution for using AntiXSS on varMethod("TokenNumber")
  • #769737
    i'm not sure that have you imported the relevant name space before you use the method.
    System.Web.Security.AntiXss

    if not please import name space and then try to check

    Thanks!
    B.Ramana Reddy

  • #769738
    Also, not sure of which .net framework are you using. in .netframework 4.5/4.6 it has method HtmlEncode() but not
    AttributeHtmlEncode()

    try to check by calling HtmlEncode method like as below

    AntiXss.AntiXssEncoder.HtmlEncode(varMethod("TokenNumber"),true)

    Thanks!
    B.Ramana Reddy


  • Sign In to post your comments