How to update content with HTML tags to database.

Hi,
I developed .Net 3.5 web application using VS 2010.
In .NET 3.5 web application I am doing the Database update with grid view data by stored procedure. The content I am trying to update from grid view column has HTML tags.

It is giving error:Potentially dangerous request.I am doing the page validation before submitting it to server.

How to update the page content with html tags.
Thanks
KavyaVSAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Meir RivkinConnect With a Mentor Full stack Software EngineerCommented:
0
 
Meir RivkinFull stack Software EngineerCommented:
Add this to your web.config:

<system.web>
    <pages validateRequest="false" />
</system.web>
0
 
KavyaVSAuthor Commented:
I can't.I have to do page validation.

I am doing Server.HtmlEncode("<data with html tags/>") before saving it.
But I am getting the same error.

Any other suggestions please.
Thanks
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Meir RivkinFull stack Software EngineerCommented:
are you using MVC?
0
 
KavyaVSAuthor Commented:
No.
 It's .Net 3.5 web application.

Thanks
0
 
KavyaVSAuthor Commented:
The example provided was for MVC.  How to use it in web application.

Thanks
0
 
KavyaVSAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.