Response Object Problem

S

Steve Bishop

I have a form with a search box that uses an OnTextChanged to query a DB
and populate a datagrid. Alternatively, I have a search button to fire
the same code. When I click on the edit link on my grid, it fires a
Response.Redirect to another form page.

The problem is when I return to my original form page (by clicking the
back button on my browser)and perform another search, instead of
returning my results in the same page grid, it somehow fires the
Response.Redirect again when I hit enter on my keyboard (without even
clicking on any of the grid edit links!). If I just use the mouse and
manually click the search button instead of using enter on the keyboard,
it works fine.

Any help appreciated.
Thanks.
 
E

eastsh

Steve said:
I have a form with a search box that uses an OnTextChanged to query a DB
and populate a datagrid. Alternatively, I have a search button to fire

I think this is a problem with how the form is by default submitted when
the enter key is pressed (IE does this by default). There are controls
that will allow you to register a script block to handle the keypress
for enter and map it to whichever event of whichever control you choose
(in your case the click for your search button)

JP
 
S

Steve Bishop

I see where you're going with this, but I noticed that if I just refresh
the page when I go back to it, it works fine. Is there a way I can
emulate the refresh each time the page is loaded?

Is this the reason we use the if(!(Page.IsPostBack) ??

Help appreciated. Thanks
 
S

Steve Bishop

All I really need is a way to refresh the page when the user hits the
back button on the browser to redisplay it. Is this possible?

Thanks.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top