 |
BOOK: Beginning ASP.NET 4 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

September 10th, 2010, 11:45 AM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 21
Thanks: 1
Thanked 1 Time in 1 Post
|
|
Try It Out Page 555
When I click the Save button, I get the Yellow Screen of Death with the message, "A potentially dangerous Request.Form value was detected from the client (ctl00$cpMainContent$SaveButton="<u>S</u>ave")."
The Description part begins, "Request Validation has detected a potentially dangerous client input value,..."
How do I solve this issue?
Also, the actual text on the button is literally <u>S</u>ave rather than Save with the S underlined. All the Labels' underlined letters appear and work correctly.
Jim
|
|

September 10th, 2010, 02:26 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Jim,
Take a look at page 316 - Understanding Request Validation. You've run into a feature of ASP.NET that protects you from injection attacks. The button's value is submitted with the form, so ASP.NET thinks you're injecting script into the request. Labels are not submitted, so they cause no problem.
Hope this helps,
Imar
|
|

September 10th, 2010, 03:09 PM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 21
Thanks: 1
Thanked 1 Time in 1 Post
|
|
So I put ValidateRequest="False" in the Page directive for the HandCoded.aspx and I still get the same error. What have I missed?
|
|

September 10th, 2010, 04:05 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You also need to set the requestValidationMode to 2.0 in the httpRuntime element under <system.web />, like this:
<httpRuntime requestValidationMode="2.0"/>
By the way, does underlining the letter work for you on a button like this? It doesn't work for me in IE 8.....
Imar
|
|

September 11th, 2010, 03:54 PM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 21
Thanks: 1
Thanked 1 Time in 1 Post
|
|
That fixes it! Thanks. (That discussion was over 200 pages ago and how soon I forget!)
I use IE 8 and the S on the button does not display properly. It is surrounded by the underline tags. Same result in Safari.
|
|

September 11th, 2010, 04:02 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Exactly. That's what I am seeing as well.
You could try to use a <button> instead if you're using client side controls: http://www.hotscripts.com/forums/htm...accesskey.html
Cheers,
Imar
|
|
 |
|