Link to home
Start Free TrialLog in
Avatar of KavyaVS
KavyaVS

asked on

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
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Add this to your web.config:

<system.web>
    <pages validateRequest="false" />
</system.web>
Avatar of KavyaVS
KavyaVS

ASKER

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
are you using MVC?
Avatar of KavyaVS

ASKER

No.
 It's .Net 3.5 web application.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KavyaVS

ASKER

The example provided was for MVC.  How to use it in web application.

Thanks
Avatar of KavyaVS

ASKER

Thanks