Solved

How to update content with HTML tags  to database.

Posted on 2013-06-16
7
220 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now