473,385 Members | 1,400 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,385 software developers and data experts.

Problem displaying text in a TextBox...

Hello, Folks...

I'm almost becoming a regular to this newsgroup.

I am trying to display the contents of an MS-SQL Text field to a TextBox in ASPdotNET. The text in this field contains all sorts of characters including cheverons (i.e. ">" and "<") and occasionally I get the following error condition (listed below). Is there anything I can do to avoid it? I use the simple line txtArticle.Text = datareader("Article") in my code to populate it.

TIA.
Server Error in '/' Application.
--------------------------------------------------------------------------------

A potentially dangerous Request.Form value was detected from the client (txtArticle="... then use <F8> to get boot men...").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (txtArticle="... then use <F8> to get boot men...").

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (txtArticle="... then use <F8> to get boot men...").]
System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +230
System.Web.HttpRequest.ValidateNameValueCollection (NameValueCollection nvc, String collectionName) +99
System.Web.HttpRequest.get_Form() +121
System.Web.UI.Page.GetCollectionBasedOnMethod() +70
System.Web.UI.Page.DeterminePostBackMode() +47
System.Web.UI.Page.ProcessRequestMain() +2106
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +87

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Nov 18 '05 #1
6 2228
Hi,

Well, I guess you should read the error description more carefully. It says:

Description: Request Validation has detected a potentially dangerous client
input value, and processing of the request has been aborted. This value may
indicate an attempt to compromise the security of your application, such as
a cross-site scripting attack. You can disable request validation by setting
validateRequest=false in the Page directive or in the configuration section.
However, it is strongly recommended that your application explicitly check
all inputs in this case.

And now once again only the workaround:

You can disable request validation by setting validateRequest=false in the
Page directive or in the configuration section

I advise you to disable it at page level. The so-called Page directive is
the first row of each page starting with <%@ Page

Greetings
Martin
"The Eeediot" <ee*****@hotmail.com> wrote in message
news:zq********************@giganews.com...
Hello, Folks...

I'm almost becoming a regular to this newsgroup.

I am trying to display the contents of an MS-SQL Text field to a TextBox in
ASPdotNET. The text in this field contains all sorts of characters
including cheverons (i.e. ">" and "<") and occasionally I get the following
error condition (listed below). Is there anything I can do to avoid it? I
use the simple line txtArticle.Text = datareader("Article") in my code to
populate it.

TIA.
Server Error in '/' Application.
----------------------------------------------------------------------------
----

A potentially dangerous Request.Form value was detected from the client
(txtArticle="... then use <F8> to get boot men...").
Description: Request Validation has detected a potentially dangerous client
input value, and processing of the request has been aborted. This value may
indicate an attempt to compromise the security of your application, such as
a cross-site scripting attack. You can disable request validation by setting
validateRequest=false in the Page directive or in the configuration section.
However, it is strongly recommended that your application explicitly check
all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially
dangerous Request.Form value was detected from the client (txtArticle="...
then use <F8> to get boot men...").

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous
Request.Form value was detected from the client (txtArticle="... then use
<F8> to get boot men...").]
System.Web.HttpRequest.ValidateString(String s, String valueName, String
collectionName) +230
System.Web.HttpRequest.ValidateNameValueCollection (NameValueCollection
nvc, String collectionName) +99
System.Web.HttpRequest.get_Form() +121
System.Web.UI.Page.GetCollectionBasedOnMethod() +70
System.Web.UI.Page.DeterminePostBackMode() +47
System.Web.UI.Page.ProcessRequestMain() +2106
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18

System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionSte
p.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

----------------------------------------------------------------------------
----
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573
Nov 18 '05 #2
@Page directive has an attribute called ValidateRequest. For the values to
contain explict < > tags you will have to set it to false.
For more information refer
http://msdn.microsoft.com/library/de.../cpconPage.asp

Read this before you apply it
http://msdn.microsoft.com/library/de...pplication.asp

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"The Eeediot" <ee*****@hotmail.com> wrote in message
news:zq********************@giganews.com...
Hello, Folks...

I'm almost becoming a regular to this newsgroup.

I am trying to display the contents of an MS-SQL Text field to a TextBox in
ASPdotNET. The text in this field contains all sorts of characters
including cheverons (i.e. ">" and "<") and occasionally I get the following
error condition (listed below). Is there anything I can do to avoid it? I
use the simple line txtArticle.Text = datareader("Article") in my code to
populate it.

TIA.
Server Error in '/' Application.
A potentially dangerous Request.Form value was detected from the client
(txtArticle="... then use <F8> to get boot men...").
Description: Request Validation has detected a potentially dangerous client
input value, and processing of the request has been aborted. This value may
indicate an attempt to compromise the security of your application, such as
a cross-site scripting attack. You can disable request validation by setting
validateRequest=false in the Page directive or in the configuration section.
However, it is strongly recommended that your application explicitly check
all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially
dangerous Request.Form value was detected from the client (txtArticle="...
then use <F8> to get boot men...").

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous
Request.Form value was detected from the client (txtArticle="... then use
<F8> to get boot men...").]
System.Web.HttpRequest.ValidateString(String s, String valueName, String
collectionName) +230
System.Web.HttpRequest.ValidateNameValueCollection (NameValueCollection
nvc, String collectionName) +99
System.Web.HttpRequest.get_Form() +121
System.Web.UI.Page.GetCollectionBasedOnMethod() +70
System.Web.UI.Page.DeterminePostBackMode() +47
System.Web.UI.Page.ProcessRequestMain() +2106
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionStep.Execute()
+179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573
Nov 18 '05 #3

Hi,

Try using HttpUtility.HtmlEncode() . To get more info check this out;
http://msdn.microsoft.com/library/de...codeTopic2.asp

Hope this helps,

Ethem

"The Eeediot" wrote:
Hello, Folks...

I'm almost becoming a regular to this newsgroup.

I am trying to display the contents of an MS-SQL Text field to a TextBox in ASPdotNET. The text in this field contains all sorts of characters including cheverons (i.e. ">" and "<") and occasionally I get the following error condition (listed below). Is there anything I can do to avoid it? I use the simple line txtArticle.Text = datareader("Article") in my code to populate it.

TIA.
Server Error in '/' Application.
--------------------------------------------------------------------------------

A potentially dangerous Request.Form value was detected from the client (txtArticle="... then use <F8> to get boot men...").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (txtArticle="... then use <F8> to get boot men...").

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (txtArticle="... then use <F8> to get boot men...").]
System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +230
System.Web.HttpRequest.ValidateNameValueCollection (NameValueCollection nvc, String collectionName) +99
System.Web.HttpRequest.get_Form() +121
System.Web.UI.Page.GetCollectionBasedOnMethod() +70
System.Web.UI.Page.DeterminePostBackMode() +47
System.Web.UI.Page.ProcessRequestMain() +2106
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +87

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322

Nov 18 '05 #4
You have to disable the validateRequest via either the:
Page directive:
<%@ Page ... validateRequest="false" %>

or the web.config:
<system.web>
<pages validateRequest="false" />
</system.web>
karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"The Eeediot" <ee*****@hotmail.com> wrote in message news:zq********************@giganews.com...
Hello, Folks...

I'm almost becoming a regular to this newsgroup.

I am trying to display the contents of an MS-SQL Text field to a TextBox in ASPdotNET. The text in this field contains all sorts of characters including cheverons (i.e. ">" and "<") and occasionally I get the following error condition (listed below). Is there anything I can do to avoid it? I use the simple line txtArticle.Text = datareader("Article") in my code to populate it.

TIA.
Server Error in '/' Application.
------------------------------------------------------------------------------

A potentially dangerous Request.Form value was detected from the client (txtArticle="... then use <F8> to get boot men...").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (txtArticle="... then use <F8> to get boot men...").

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (txtArticle="... then use <F8> to get boot men...").]
System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +230
System.Web.HttpRequest.ValidateNameValueCollection (NameValueCollection nvc, String collectionName) +99
System.Web.HttpRequest.get_Form() +121
System.Web.UI.Page.GetCollectionBasedOnMethod() +70
System.Web.UI.Page.DeterminePostBackMode() +47
System.Web.UI.Page.ProcessRequestMain() +2106
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +87

------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Nov 18 '05 #5
Use Server.HTMLEncode before displaying the information. This will
encode the string so that it will display properly in HTML.

A note on the error: The validation request exception is raised to
prevent cross-site scripting from being exploited. ASP.Net checks for
possible script tags and other information being submitted to the
browser via input. This can be disabled in cases where you want to
submit script values (such as a WYSIWYG editor) by setting the
ValidateRequest page directive to false, <@% Page
validateRequest="false" %>, but this is not recommended.

Joel Cade, MCSD .Net, MCAD, MCP
Fig Tree Solutions, LLC
http://www.figtreesolutions.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #6
Hehehe.

I did choose the name aptly.
"Martin Dechev" <de*******@hotmail.com> wrote in message
news:OU**************@TK2MSFTNGP14.phx.gbl...
Hi,

Well, I guess you should read the error description more carefully. It says:
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check
all inputs in this case.

And now once again only the workaround:

You can disable request validation by setting validateRequest=false in the
Page directive or in the configuration section

I advise you to disable it at page level. The so-called Page directive is
the first row of each page starting with <%@ Page

Greetings
Martin
"The Eeediot" <ee*****@hotmail.com> wrote in message
news:zq********************@giganews.com...
Hello, Folks...

I'm almost becoming a regular to this newsgroup.

I am trying to display the contents of an MS-SQL Text field to a TextBox in ASPdotNET. The text in this field contains all sorts of characters
including cheverons (i.e. ">" and "<") and occasionally I get the following error condition (listed below). Is there anything I can do to avoid it? I use the simple line txtArticle.Text = datareader("Article") in my code to
populate it.

TIA.
Server Error in '/' Application.
-------------------------------------------------------------------------- -- ----

A potentially dangerous Request.Form value was detected from the client
(txtArticle="... then use <F8> to get boot men...").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check
all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (txtArticle="...
then use <F8> to get boot men...").

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous
Request.Form value was detected from the client (txtArticle="... then use
<F8> to get boot men...").]
System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +230
System.Web.HttpRequest.ValidateNameValueCollection (NameValueCollection
nvc, String collectionName) +99
System.Web.HttpRequest.get_Form() +121
System.Web.UI.Page.GetCollectionBasedOnMethod() +70
System.Web.UI.Page.DeterminePostBackMode() +47
System.Web.UI.Page.ProcessRequestMain() +2106
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18

System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionSte p.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

-------------------------------------------------------------------------- -- ----
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

Nov 18 '05 #7

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

Similar topics

8
by: BiNZGi | last post by:
Hi I have reduced the problem to this code: <form> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><input type="text" style="width: 100%;" value="Lorem ipsum dolor...
2
by: TattyMane bigpond.net.au> | last post by:
asp.net, visual studio 2003, IE6 I have a sample web page that is linked to another page. On the first page, I have a text box, on the second, the first page's text box text is displayed using a...
0
by: Earl Teigrob | last post by:
I can create a new custom control (and not change it) and add it to the toolbox and drag it onto the disign screen and it works just fine, displaying the text . However, when I add the following...
1
by: Patrick.O.Ige | last post by:
Hello guys i made a Datagrid with Editing,Update and Cancel using VS.NET. to my surprise nothing is on the screen after compilation .. By code below:- Imports System.Data Imports...
3
by: Ipsita | last post by:
Hi! I am trying SOAP with DIME attachments in web services. For example say, I have a file resume.pdf stored somewhere on my server. How does the web service send the file to the client, so that...
2
by: Mad Scientist Jr | last post by:
i'm trying to read a file byte by byte (and later alter the data and write it to a 2nd file byte by byte) and running into a problem where it seems to keep reading the same byte over and over again...
6
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns...
0
by: Phil G. | last post by:
Hi, my 'project' requires that I create a form with text info. at set time periods. These time periods are not evenly spaced so I pass a param for the delay(seconds). In order to debug this I have...
2
by: sweatha | last post by:
Hi friends This is sweatha, fresher MCA 2007 batch. Right now I am working in asp.net platform. My dillema is that I have created a registration form with the fields as username & password. And if...
6
by: IReallyNeedHelp | last post by:
I have saved the questions using AddQuestion.aspx page i have created but i don't know how to display it and calculate their score. this is the formview i have done, but there is some error ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.