@Page validateRequest And UserControls

Discussion in 'ASP .Net' started by =?Utf-8?B?UmF5IFdpbGxpYW1z?=, May 7, 2004.

  1. I have a specific page that I have chosen to disable the .NET 1.1 validateRequest options by setting the page directive attribute of "validateRequest" from true to false. I manually validate all controls within this page. This page includes a UserControl which contains a textbox. It appears that the validateRequest attribute is not propagated to the usercontrol when the page is processed. This results in the standard "potentially dangerous" error being thrown, even though this process should be disabled for the entire form

    I have not been able to locate an attribute for disabling client input validation against controls found in a UserControl. Shouldn't the validateRequest setting for the hosting page propagate to the UserControl

    I have seen option for performing client side javascript HtmlEncoding to prevent this error. However, I need a more passive option that does not require the user to trigger the validation themselves.
     
    =?Utf-8?B?UmF5IFdpbGxpYW1z?=, May 7, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?UmF5IFdpbGxpYW1z?=

    avnrao Guest

    It works. i did a sample pro on it. created a user control with a text box
    and added it in a page.
    enabled validateRequest : gave an error.
    disabled vaidateRequest : typed object tag in user control text box. it
    doesnt validate.

    Av.

    "Ray Williams" <> wrote in message
    news:...
    >I have a specific page that I have chosen to disable the .NET 1.1
    >validateRequest options by setting the page directive attribute of
    >"validateRequest" from true to false. I manually validate all controls
    >within this page. This page includes a UserControl which contains a
    >textbox. It appears that the validateRequest attribute is not propagated
    >to the usercontrol when the page is processed. This results in the
    >standard "potentially dangerous" error being thrown, even though this
    >process should be disabled for the entire form.
    >
    > I have not been able to locate an attribute for disabling client input
    > validation against controls found in a UserControl. Shouldn't the
    > validateRequest setting for the hosting page propagate to the UserControl?
    >
    > I have seen option for performing client side javascript HtmlEncoding to
    > prevent this error. However, I need a more passive option that does not
    > require the user to trigger the validation themselves.
     
    avnrao, May 7, 2004
    #2
    1. Advertising

  3. Av. - Thanks for the quick reply. I just finished creating a new web application in an attempt to reproduce the error as well. Unfortunately, I was unable to duplicate my error in the new app. However, I still receive the "potentially dangerous" error message in my original application. I just checked my code again and I indeed have the validateRequest attibute set to false. Can you think of any other reason that this error would appear if the attribute is set to false

    Thanks
    Ra

    ----- avnrao wrote: ----

    It works. i did a sample pro on it. created a user control with a text box
    and added it in a page
    enabled validateRequest : gave an error
    disabled vaidateRequest : typed object tag in user control text box. it
    doesnt validate

    Av

    "Ray Williams" <> wrote in message
    news:..
    >I have a specific page that I have chosen to disable the .NET 1.1
    >validateRequest options by setting the page directive attribute of
    >"validateRequest" from true to false. I manually validate all controls
    >within this page. This page includes a UserControl which contains a
    >textbox. It appears that the validateRequest attribute is not propagated
    >to the usercontrol when the page is processed. This results in the
    >standard "potentially dangerous" error being thrown, even though this
    >process should be disabled for the entire form
    >> I have not been able to locate an attribute for disabling client input

    > validation against controls found in a UserControl. Shouldn't the
    > validateRequest setting for the hosting page propagate to the UserControl
    >> I have seen option for performing client side javascript HtmlEncoding to

    > prevent this error. However, I need a more passive option that does not
    > require the user to trigger the validation themselves.
     
    =?Utf-8?B?UmF5IFdpbGxpYW1z?=, May 7, 2004
    #3
  4. Av. - I modified my web.config to include the following section
    <location path="Directory1/Directory1a/WebPage.aspx"><system.web><pages validateRequest="false"/></system.web></location
    Everything seems to be working correctly now
    Thanks for your help.
     
    =?Utf-8?B?UmF5IFdpbGxpYW1z?=, May 7, 2004
    #4
  5. =?Utf-8?B?UmF5IFdpbGxpYW1z?=

    avnrao Guest

    thats cool. i think now you can remove this code from web.config and put
    back your @Page attribute. it will work i guess.

    Av.
    "Ray Williams" <> wrote in message
    news:...
    > Av. - I modified my web.config to include the following section.
    > <location path="Directory1/Directory1a/WebPage.aspx"><system.web><pages
    > validateRequest="false"/></system.web></location>
    > Everything seems to be working correctly now.
    > Thanks for your help.
     
    avnrao, May 7, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Zych
    Replies:
    2
    Views:
    25,693
    Tim Zych
    May 16, 2004
  2. Phil Winstanley [Microsoft MVP ASP.NET]

    Re: validateRequest=&quot;false&quot; not working in web.config or page directive

    Phil Winstanley [Microsoft MVP ASP.NET], May 16, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    659
    Phil Winstanley [Microsoft MVP ASP.NET]
    May 16, 2004
  3. Umut Tezduyar
    Replies:
    3
    Views:
    2,299
    Scott Allen
    Nov 13, 2004
  4. \A_Michigan_User\
    Replies:
    2
    Views:
    942
    \A_Michigan_User\
    Aug 21, 2006
  5. Edwin Knoppert
    Replies:
    0
    Views:
    925
    Edwin Knoppert
    Oct 19, 2006
Loading...

Share This Page