Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/09/2004, 20:31
Stream
 
Fecha de Ingreso: mayo-2004
Ubicación: Guadalajara, Jalisco, México
Mensajes: 724
Antigüedad: 20 años
Puntos: 6
Evitar el error al insertar Html en un texbox ?

Hola amigos.. sucede que tengo un formulario donde necesito recojer datos html y guardarlos en la bd..

pero asp.net marka error por que lo que se envia son tags html..

Para pobrar lo que digo hagan esto:
Creen un nuevo proyecto o simplemente haganlo en una pagina que ya tengan..

Agregen un texbox a la pagina y un boton... ejecuten... y metan <table> al contenido del texbox,, y presionen enter...

asp.net les madara un error, como evito eso?

A potentially dangerous Request.Form value was detected from the client (Ctrl_Razas1:txtRaza="<table>").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (Ctrl_Razas1:txtRaza="<table>").

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

De hecho ya intente con el
validateRequest=false

pero no jala.. sera por que mi texbox esta en un user control ? alguien sabe?