PDA

View Full Version : c# web forms "A potentially dangerous Request.Form value.. "


The March
29-12-2005, 18:04
:mbe:

Ola..

Sto sviluppando un progetto su web forms in c#...
ma mi sono accorto che inserendo alcuni caratteri mi restituisce il seguente errore

"A potentially dangerous Request.Form value was detected from the client (txtCampaignId="<a>")."


nello specifico...

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.

Stack Trace:


[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (txtCampaignId="<a>").]
System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName)
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName)
System.Web.HttpRequest.get_Form() +113
System.Web.UI.Page.GetCollectionBasedOnMethod()
System.Web.UI.Page.DeterminePostBackMode()
System.Web.UI.Page.ProcessRequestMain()
System.Web.UI.Page.ProcessRequest()
System.Web.UI.Page.ProcessRequest(HttpContext context)
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


:mbe:
sicuramente da problemi con
<a>
<a
<parolaacaso>

qualcuno sa aiutarmi? :mc:


grazie!!!

The March
29-12-2005, 18:19
Mi piaccio troppo quando scrivo le domande e me le rispondo da solo! :sofico:


Link (http://www.cryer.co.uk/brian/mswinswdev/ms_vbnet_server_error_potentially_dangerous.htm)



:mbe: ora il problema è un'altro...

quando visualizzo qualcosa tipo <a> in una label... checcavolo il client lo vede come html e non lo scrive mica!!! :sofico:


:muro:

Fenomeno85
30-12-2005, 19:05
devi convertire < > in &lt e &gt

~§~ Sempre E Solo Lei ~§~

The March
02-01-2006, 19:16
devi convertire < > in &lt e &gt

~§~ Sempre E Solo Lei ~§~

:muro: grazie :doh: