Link to home
Start Free TrialLog in
Avatar of osion
osion

asked on

forcing a page postback to reload the page and keep current information

Hi All,
Is it possible to force a page to postback and keep its viewstate?

The long version of the problem is:
I have a page where the user selects several values of things in controls for a report and then clicks a button. The code behind the button event takes the controls values and builds up a querystring which is then passed to a report component.

I have to open the report in a new window so i use this code:
Response.Write("<script>");
Response.Write("window.open(\"/ReporterMaker/makereport.asp?" + strReportParams + "\")");
Response.Write("</script>");

This all works fine until I noticed that this javascrtipt prevents the 3rd party javascript menu we are using. I cant debug the problem with the menu so i dont know whats going on there. So I reckon if I just postback it should solve the problem.

Thanks in advance.
O
Avatar of crazyman
crazyman
Flag of United Kingdom of Great Britain and Northern Ireland image

Page.ClientScript.RegisterStartupScript(this.GetType(), "ForcePostback", this.ClientScript.GetPostBackEventReference(this.YourControlNameToPostBAck), true);
Avatar of osion
osion

ASKER

Hi there crazyman,
thanks for the answer!
will that postback once the control is clicked?
i kinda need to do the postback after i ve printed the script stuff in the code behind
ASKER CERTIFIED SOLUTION
Avatar of samtran0331
samtran0331
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of osion

ASKER

Thats exactly it! :)
I thought there might be another way to do that but wasnt sure!
Thanks a million..
O