Howto catch HttpRequestValidationException myself

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Re: Howto catch HttpRequestValidationException myself

    Hi Henk,

    As with any other exception you can catch it in the Error event of the Page
    and Error event of the Application. But you won't be able to continue the
    normal execution of the page after this exception fires. If you want to
    provide your own checkings you should disable the built-in validation and
    write your own.

    To learn more about how ValidateRequest internally works take a look at:

    [url]http://weblogs.asp.net/vga/posts/6329.aspx[/url]
    [url]http://weblogs.asp.net/vga/posts/7170.aspx[/url]

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    [url]http://obies.com/vga/blog.aspx[/url]
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "Henk" <THIS@IS.FAKE_USE_REPLY_ADRES> wrote in message
    news:e9tI%23m3RDHA.304@tk2msftngp13.phx.gbl...
    > I want to catch the HttpRequestValidationException exception in my code,
    so
    > I can check the input for potentially malicious code myself. But.... how
    do
    > I do this and allow the rest of the pagecode to run?
    >
    > Henk
    >
    >

    Victor Garcia Aprea [MVP] Guest

  2. Similar Questions and Discussions

    1. catch 401.2 error
      Dear collegues! I am trying to create a single Login Application, that can either authenticate against a database or against ADSI. Intenal users...
    2. catch an 401.2 error
      Dear collegues! I am trying to create a single Login Application, that can either authenticate against a database or against ADSI. Intenal users...
    3. [PHP] Try/Catch
      Try/Catch Well, may question is about the Scope of Throwed Execeptions. What version of PHP are you running? Only V5 has this kind of...
    4. Try/Catch
      Well, may question is about the Scope of Throwed Execeptions. Look my example: I have something like this: //...cut... try { $res =...
    5. ASP catch exception
      I use the following code and get the following error message in my ASP page(not .net). Please help try mycode Catch ex As Exception...
  3. #2

    Default Re: Howto catch HttpRequestValidationException myself

    Hi Henk,

    As with any other exception you can catch it in the Error event of the Page
    and Error event of the Application. But you won't be able to continue the
    normal execution of the page after this exception fires. If you want to
    provide your own checkings you should disable the built-in validation and
    write your own.

    To learn more about how ValidateRequest internally works take a look at:

    [url]http://weblogs.asp.net/vga/posts/6329.aspx[/url]
    [url]http://weblogs.asp.net/vga/posts/7170.aspx[/url]

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    [url]http://obies.com/vga/blog.aspx[/url]
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "Henk" <THIS@IS.FAKE_USE_REPLY_ADRES> wrote in message
    news:e9tI%23m3RDHA.304@tk2msftngp13.phx.gbl...
    > I want to catch the HttpRequestValidationException exception in my code,
    so
    > I can check the input for potentially malicious code myself. But.... how
    do
    > I do this and allow the rest of the pagecode to run?
    >
    > Henk
    >
    >

    Victor Garcia Aprea [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139