Saturday, March 31, 2012

Submitting HTML page data through form.

Hi,

Iam trying to submit data using form.
I have taken Text area in the form.
I want to submit Html page data(data is something like <Html> <body> hello</body></html>)
through this form.

But it is giving error. How to handle this situation

Server Error in '/webs' Application.
------------------------

A potentially dangerous Request.Form value was detected from the client (ta=" <html><head></head><...").Please read the following:
Request Validation - Preventing Script Attacks

It will show you how you can effectively "turn off" this error. However, youmust take notice of the warnings in red text. Do not just turn off the error, without validating the input yourself.
Hi,

.NET 1.1 has built in protection against script injections through textbox, textareas etc., However, if you are sure that your users won't do the hacking, you can remove this checking functionality by adding the ValidateRequest="false" to the @.Page directive of your aspx page.

If you want this for whole of your application, you can specify the same in the web.config

Hope it helps.
Hello
Thanks for help.

It is working fine.

But While printing the result it is printing like
<html><head></head><body>hello</body></html>
How to handle this situation.
Hi there,

You will have to decode the information before actually bind to a control.

for e.g

Text1.text = Server.htmldecode(dr("myHtml).tostring)

HTH
Thanks to all .
It is running fine.

0 comments:

Post a Comment