By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,365 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,365 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <an*******@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
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
Nov 18 '05 #2

P: n/a
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" <an*******@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
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
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.