• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

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
0
KavyaVS
Asked:
KavyaVS
  • 4
  • 3
1 Solution
 
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
 
Meir RivkinFull stack Software EngineerCommented:
are you using MVC?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
KavyaVSAuthor Commented:
No.
 It's .Net 3.5 web application.

Thanks
0
 
Meir RivkinFull stack Software EngineerCommented:
0
 
KavyaVSAuthor Commented:
The example provided was for MVC.  How to use it in web application.

Thanks
0
 
KavyaVSAuthor Commented:
Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now