¿Cómo usar Server.HtmlEncode con cuadro de texto en ASP.NET?
Frecuentes
Visto 1,577 veces
3 Respuestas
0
you must pass special caracter in your textbox for example < or > ...
you can adjust ValidateRequest to false in order to authorize, you adjust on your page
<%@ Page validateRequest="false" %>
Respondido 28 ago 12, 13:08
0
If you want to allow these values, add ValidateRequest="false"
En el correo electrónico “Su Cuenta de Usuario en su Nuevo Sistema XNUMXCX”. <%@ page
declaración
Be aware that this does leave you more vulnerable to potential XSS attacks, etc.
Respondido 28 ago 12, 13:08
0
If you use .NET 4.5 you can set the requestValidationMode to 4.5:
<httpRuntime requestValidationMode="4.5" />
And then access the unvalidated querystring of form field data with:
Request.Unvalidated.Form["name"];
Then you can html decode the string to prevent XSS, I recommend to use the AntiXSS library for this (it's baked in ASP.NET 4.5).
Respondido 28 ago 12, 14:08
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas asp.net textbox or haz tu propia pregunta.
Why do you want to support html in your textbox? Do you want to use it as a RichText Editor? - Erwin
no actually our Project Manager has showed me a checklist in which this type of text also included so i am just working on that..... - Ram Singh