Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response.redirect

Status
Not open for further replies.

ami7

Programmer
Oct 3, 2002
48
GB
Hi all,

Im my .aspx page(eg: emp.aspx) i have 2 buttons.
1) populate
2) preview
By clicking on populate button it populates a datagrid control then in the same page it displays the preview button. On the clik event of the preview button am calling a report.
In my report i navigate to different pages using custom toolbar..Also i have an exit button in my tool bar to navigate to emp.aspx page.
Basically am using response.redirect command in my exit button to go that page .

Problem:
If i say response.redirect it re-loads the page frshly and it does not display the populated datagrid and preview button .

wat i want is : when i click on exit button it should go to emp.aspx page which has the poplated grid and the preview button.

any tips?

thanks in advance.
ami.
 
Instead of having hte populate code in the button, stick it in the page load event around a

If Not page.ispostback Then

End If

block. That way, whenever the page is accessed without being a postback, the datagrid will always be populated.

D'Arcy
 
Hi d'arcy,

Thanks.
I can't use that code on page_load cos, on the load event am trying to populate a listbox control and also fill up few fields(el: lable control) on emp.aspx page.

It should populate the grid only when i clik on the populate button.
Once it is populated it will diplay the preview button to view the report.

Is there any other way to get back to the emp.aspx page (retaining the same state) ie. with the populated grid and other fields in the page.

Thanks for ur help.

ami.
 
Ah, ok.

Well, you could just add an attribute for a button's onclick event, and do a (I *think*this is the syntax)
window.back(1)

This will make the button operate like the back button on the browser.

of course, this will only work as long as you aren't setting the page's cache timeout.

D
 
wasn't it more like:

window.history.back(1)

???
or something similar =) Daren J. Lahey
Just another computer guy...
FAQ183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
Support your forums TODAY!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top