none
HTMLEncode-Decode increases character limit RRS feed

  • Question

  • Hi All,

    We have one web form having many textboxes. Each is having some character limit as per business needs. To handle Cross Site Scripting, we are using

    1) HTMLEncode - while fetching data from user input,

    2) store it in our custom document library &

    3) HTMLDecode - while retrieving data from custom document library & set it on web page

    Problem Statement:

    A textbox having business need as 255 max characters. We have JavaScript validation in place which checks this. But after implementing HTMLEncode; the actual characters are getting increased. 

    e.g. If user is using symbol as < in textbox when we encode it; it's going as &lt so even if user is inputting 255 characters, in the background the total length is becoming more than 255 & throwing error & so not updating.

    Can anyone please guide us in this?

    Thanks,

    Sanjay

    • Moved by CoolDadTx Tuesday, January 17, 2017 2:54 PM ASP.NET related
    Tuesday, January 17, 2017 11:00 AM

All replies