Solved

How to update content with HTML tags  to database.

Posted on 2013-06-16
7
223 Views
Last Modified: 2013-07-31
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
Comment
Question by:KavyaVS
  • 4
  • 3
7 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 39251144
Add this to your web.config:

<system.web>
    <pages validateRequest="false" />
</system.web>
0
 

Author Comment

by:KavyaVS
ID: 39251152
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
 
LVL 42

Expert Comment

by:sedgwick
ID: 39251155
are you using MVC?
0
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.

 

Author Comment

by:KavyaVS
ID: 39251161
No.
 It's .Net 3.5 web application.

Thanks
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39251184
0
 

Author Comment

by:KavyaVS
ID: 39251921
The example provided was for MVC.  How to use it in web application.

Thanks
0
 

Author Closing Comment

by:KavyaVS
ID: 39372028
Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question