Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : 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
 
Old December 24th, 2013, 03:22 PM
Authorized User
 
Join Date: Aug 2011
Posts: 44
Thanks: 14
Thanked 0 Times in 0 Posts
Default ValidateRequestMode=Enabled

On page 333 (chapter 9 - Validate user input), I read:

"When set to Enabled, the control does not accept HTML; when set to Disabled the control does accept HTML".

Unfortunately, in both cases I get the same unhandled exception (in figure 9-10, on page 333).

How can I handle this exception nicely and protect my controls from Cross site Scripting Attacks ?

Thank you
Roberto
 
Old December 25th, 2013, 09:06 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Antonius,

How does your web.config look? It works for me with the following code:

Code:
<system.web>
  ...
  <httpRuntime requestValidationMode="4.5"/>
  ...
</system.web>
Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Antonius Block (December 25th, 2013)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Javascript enabled on my P.C. ? liamfitz Javascript 1 May 31st, 2009 02:10 AM
Ajax enabled website priyan.viji .NET Framework 2.0 0 August 20th, 2007 04:33 AM
Authentication is not enabled ayyub123 ASP.NET 2.0 Basics 0 May 29th, 2007 01:49 AM
Validate only if enabled bleutiger Other Programming Languages 0 April 25th, 2006 07:15 PM
How to detect whether cookie is enabled or not. lily611 Javascript 2 July 26th, 2005 03:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.