Page appears to fail validation even though it has no validation controls

Discussion in 'ASP .Net' started by =?Utf-8?B?ZGh1cndpdHo=?=, Apr 9, 2004.

  1. Hi

    I have developed a web app with a dozen or so pages, which allows searching for and editing orders by OrderID. There is a search page for entering multiple search criteria. In addition, each page has a nav bar (actually a user control) along the side which also has a textbox for entering an OrderID, allowing simple searches from any page in the app. This navbar search textbox has a button associated with it which is disabled until the user enters a search value, at which point it becomes enabled. The user can either click the button or press Enter (since the button has focus) and the search commences

    The problem is that on one of the pages, pressing Enter disables the search button but does not do the search, although you can click the button and the search performs correctly. It is behaving as though there is a validation failure on the page, because the page is never getting posted back to the server, i.e. the button click event handler is not getting called. I have verified that there are in fact no validation controls on the errant page

    After setting ValidateRequest to false in the @Page directive, everything worked correctly. However, I do not want to leave that attribute set, due to the security implications

    So the questions are
    1. Why is the one page behaving this way when none of the other pages are
    2. Why does ValidateRequest fix the problem
    3. How can I make the page work correctly without setting ValidateRequest

    Thanks

    Dan Hurwitz
     
    =?Utf-8?B?ZGh1cndpdHo=?=, Apr 9, 2004
    #1
    1. Advertising

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

    Teemu Keiski Guest

    Hi,

    this has nothing to do with validation controls. I don't know why it would
    work when ValidateRequest is false (ValidateRequest impacts ASP.NET checking
    if malicious HTML inputs like script and such are trying to be injected).
    Anyway,pressing Enter in TextBox is known problem, it is IE related. Andy
    Smith has written a control to overcome this problem (which is tried to be
    fixed in ASp.NEt v2 as well. IIRC).

    http://www.metabuilders.com/Tools/DefaultButtons.aspx

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke


    "dhurwitz" <> wrote in message
    news:...
    Hi,

    I have developed a web app with a dozen or so pages, which allows searching
    for and editing orders by OrderID. There is a search page for entering
    multiple search criteria. In addition, each page has a nav bar (actually a
    user control) along the side which also has a textbox for entering an
    OrderID, allowing simple searches from any page in the app. This navbar
    search textbox has a button associated with it which is disabled until the
    user enters a search value, at which point it becomes enabled. The user can
    either click the button or press Enter (since the button has focus) and the
    search commences.

    The problem is that on one of the pages, pressing Enter disables the search
    button but does not do the search, although you can click the button and the
    search performs correctly. It is behaving as though there is a validation
    failure on the page, because the page is never getting posted back to the
    server, i.e. the button click event handler is not getting called. I have
    verified that there are in fact no validation controls on the errant page.

    After setting ValidateRequest to false in the @Page directive, everything
    worked correctly. However, I do not want to leave that attribute set, due
    to the security implications.

    So the questions are:
    1. Why is the one page behaving this way when none of the other pages are?
    2. Why does ValidateRequest fix the problem?
    3. How can I make the page work correctly without setting ValidateRequest?

    Thanks.

    Dan Hurwitz
     
    Teemu Keiski, Apr 10, 2004
    #2
    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. Joergen Bech
    Replies:
    2
    Views:
    3,294
    Joergen Bech
    Jul 2, 2005
  2. Patel
    Replies:
    6
    Views:
    40,554
    Randall R Schulz
    Oct 23, 2003
  3. Patel
    Replies:
    1
    Views:
    420
    Harald Hein
    Oct 23, 2003
  4. Cat
    Replies:
    2
    Views:
    1,277
  5. max.gruber
    Replies:
    4
    Views:
    151
    Mumia W. (NOSPAM)
    Jan 28, 2007
Loading...

Share This Page