 |
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
|
|
|
|
|

July 20th, 2010, 11:36 PM
|
|
Registered User
|
|
Join Date: Jul 2010
Posts: 3
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
Chapter 9 and 316pages,Request Validation
I setting the ValidateRequest attribute in the @Page directive to False,but it still
throw an exception.
Here is a part of Description:
To allow pages to override application request validation settings,set the requestValidationMode attribute in the httpRuntime configuration section to requestValidationMode="2.0".
|
|

July 21st, 2010, 02:53 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
As the error message suggests, you need to add <httpRuntime requestValidationMode="2.0" /> to your web.config, like this:
Code:
<system.web>
...
<httpRuntime requestValidationMode="2.0" />
...
</system.web>
This puts validation in a 2.0 compatible mode, which makes Request Validation work again.
Hope this helps,
Imar
Last edited by Imar; July 21st, 2010 at 03:06 AM..
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

July 21st, 2010, 03:33 AM
|
|
Registered User
|
|
Join Date: Jul 2010
Posts: 3
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
Thank you for your reply Imar.
The problem has been solved when i add<httpRuntime equestValidationMode="2.0" /> to web.config.

|
|

July 25th, 2010, 11:09 PM
|
|
Registered User
|
|
Join Date: May 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
ValidateRequest problem
is it a bug in .NET 4 ?
|
|

July 26th, 2010, 02:40 AM
|
|
Registered User
|
|
Join Date: Jul 2010
Posts: 3
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by sadeghhp
is it a bug in .NET 4 ?
|
maybe author forgot to write <httpRuntime requestValidationMode="2.0" />
settings in the book or this settings is default in asp.net 4 for security.
|
|

July 26th, 2010, 04:00 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
The need to add the attribute was added to .NET after I sent in my chapter to Wrox, so I wasn't aware of the problem until after the book was released.
And no, it's not a bug in .NET; it's a feature: http://www.asp.net/learn/whitepapers...__Toc256770147
Cheers,
Imar
|
|
The Following 2 Users Say Thank You to Imar For This Useful Post:
|
|
|
 |
|