473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

HTML tags in Textbox

I hv to store data with HTML tags in database. user will input data
with html tags for e.g.<strong> Name <strong>. And when i will read
data in webpage then "Name" should eb bold. but i m getting problem in
storing data in database.
When i input text with html tags in textbox and click on
submit...Following error comes:
A potentially dangerous Request.Form value was detected from the
client (textbox11="<strong>...").

Plz Help...
Nov 19 '05 #1
4 10795
ASP.Net 1.1 had a new feature which tries to protect against script
injection attacks. Check out http://asp.net/faq/RequestValidation.aspx for
more information.

Quickly though you can disable this via <%@ Page validateRequest="false"
....>

or in the web.config for your entier application:
<system.web>
<page validateRequest="false" />
</system.web>

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Deepak Mehta" <de********@gmail.com> wrote in message
news:b0************************@posting.google.com ...
I hv to store data with HTML tags in database. user will input data
with html tags for e.g.<strong> Name <strong>. And when i will read
data in webpage then "Name" should eb bold. but i m getting problem in
storing data in database.
When i input text with html tags in textbox and click on
submit...Following error comes:
A potentially dangerous Request.Form value was detected from the
client (textbox11="<strong>...").

Plz Help...

Nov 19 '05 #2
Hi Deepak,

That's a security measure built into ASP.NET 1.1 to stop hackers from
inserting scripting attacks.

"In ASP.NET 1.1, when turned on, the ValidateRequest attribute on the @Page
directive checks that users are not sending potentially dangerous HTML
markup in query strings, cookies, or form fields. If that is detected, an
exception is thrown and the request aborts. The attribute is on by default;
you don't have to do anything to be protected. If you want to allow HTML
markup to pass, then you must actively disable it."

<%@ Page ValidateRequest="false" %>

Let us know?

Ken
Microsoft MVP [ASP.NET]
Toronto
"Deepak Mehta" <de********@gmail.com> wrote in message
news:b0************************@posting.google.com ...
I hv to store data with HTML tags in database. user will input data
with html tags for e.g.<strong> Name <strong>. And when i will read
data in webpage then "Name" should eb bold. but i m getting problem in
storing data in database.
When i input text with html tags in textbox and click on
submit...Following error comes:
A potentially dangerous Request.Form value was detected from the
client (textbox11="<strong>...").

Plz Help...


Nov 19 '05 #3
Here's the link for more info. Look for ValidateRequest :

http://msdn.microsoft.com/library/de...tybarriers.asp

"Deepak Mehta" <de********@gmail.com> wrote in message
news:b0************************@posting.google.com ...
I hv to store data with HTML tags in database. user will input data
with html tags for e.g.<strong> Name <strong>. And when i will read
data in webpage then "Name" should eb bold. but i m getting problem in
storing data in database.
When i input text with html tags in textbox and click on
submit...Following error comes:
A potentially dangerous Request.Form value was detected from the
client (textbox11="<strong>...").

Plz Help...


Nov 19 '05 #4
I will say the this type of code i.e., embedding the UI code in the database
is not standard way. When you
do a code it should follow tier architecture so, that the presentation and
business logic
will be separated. And, other demerit of this code is ,even if asp is
accepting a request data which contains
a html elements will not safe as it might get hacked by the users.

If you allow html tags in your user input forms, one can execute a
javascript located in somewhere else
to do some unwanted activities.

So, my suggestion is avoid this kind of code and try to be more standard
in your coding strategies.

--
Vadivel Kumar
http:\\charpblogs.blogspot.com

"Deepak Mehta" <de********@gmail.com> wrote in message
news:b0************************@posting.google.com ...
I hv to store data with HTML tags in database. user will input data
with html tags for e.g.<strong> Name <strong>. And when i will read
data in webpage then "Name" should eb bold. but i m getting problem in
storing data in database.
When i input text with html tags in textbox and click on
submit...Following error comes:
A potentially dangerous Request.Form value was detected from the
client (textbox11="<strong>...").

Plz Help...

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Donald Firesmith | last post by:
Are html tags allowed within meta tags? Specifically, if I have html tags within a <definition> tag within XML, can I use the definition as the content within the <meta content="description> tag? ...
15
by: Jeff North | last post by:
Hi, I'm using a control called HTMLArea which allows a person to enter text and converts the format instructions to html tags. Most of my users know nothing about html so this is perfect for my...
18
by: Robert Bowen | last post by:
Hello peeplez. I have an odd problem. When I put the ANSI symbol for "less than" ("<"), the word STRONG and then the ANSI symbol for "greater than" (">") in my web page, followed by some text, then...
2
by: hoz | last post by:
Hi , i have a web from contains textbox and insert to db button .When i write html tags inside text , the code is blocked , how can i enter information like ? <p> Hi </p> thanks
3
by: Joe via DotNetMonster.com | last post by:
Hi, I have an form that saves to a database. I would like the user to be able to enter HTML tags into the Textbox Control fields but I get an error message when entering HTML tags: A...
4
by: Spondishy | last post by:
Hi, I'm looking for help with a regular expression and c#. I want to remove all tags from a piece of html except the following. <a> <b> <h1> <h2>
10
by: Barry L. Camp | last post by:
Hi all... hope someone can help out. Not a unique situation, but my search for a solution has not yielded what I need yet. I'm trying to come up with a regular expression for a...
17
by: V S Rawat | last post by:
I joined this ng and tried to post my first message that had a small php code (HTML and all). my newsserver aioe.net rejected the post saying "HTML Tags". My message was in text format, not in...
1
by: SM | last post by:
Hello, I have a couple of XML files that represent articles. Each XML file is unique. Meaning that overall the structure is the same but some tags in the xml file are not in the same place or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.