Advertisement
Guest User

Untitled

a guest
Oct 14th, 2010
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.37 KB | None | 0 0
  1. using System.Web;
  2. using System.Web.Util;
  3.  
  4. namespace Globals
  5. {
  6.  
  7.     /// <summary>
  8.     /// Summary description for CustomRequestValidation
  9.     /// </summary>
  10.     public class CustomRequestValidation : RequestValidator
  11.     {
  12.         public CustomRequestValidation() { }
  13.         protected override bool IsValidRequestString(HttpContext context, string value, RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex)
  14.         {
  15.             validationFailureIndex = -1;
  16.             return true;
  17.             /*validationFailureIndex = -1;
  18.             if (requestValidationSource == RequestValidationSource.Path)
  19.             {
  20.                 // value "&","="  allowed.
  21.                 if (value.Contains("&") || value.Contains("="))
  22.                 {
  23.                     validationFailureIndex = -1;
  24.                     return true;
  25.                 }
  26.                 else
  27.                 {
  28.                     //Leave any further checks to ASP.NET.          
  29.                     return base.IsValidRequestString(context, value, requestValidationSource, collectionKey, out validationFailureIndex);
  30.                 }
  31.             }
  32.             else
  33.             {
  34.                 return base.IsValidRequestString(context, value, requestValidationSource, collectionKey, out validationFailureIndex);
  35.             }*/
  36.  
  37.  
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement