Click here to Skip to main content
15,921,179 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my application the user will fill certain page and after that, he will safe the data to the database. After saving the data to the database, he will need to print the data and refresh the page to accept new input. I have done the following:

ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('PrintHelperDocument.aspx','PrintMe','height=500px,width=1000px,scrollbars=1');</script>");
Response.Redirect("BondData.aspx");
If I did this, the print page is not opened and only the current page get refreshed. how can I open the new page and at the same time refresh the current one?
Posted

You'll want to do it all in JavaScript. Remember what is happening. All of the C# code executes and then sends the html to the client. So, since you end with a Response.Redirect to a new page, that is the only page sent to the client so your JavaScript to open the window is never sent.

Have a function in JS similar to:
JavaScript
function Something()
{
 window.open('PrintHelperDocument.aspx','PrintMe','height=500px,width=1000px,scrollbars=1');
 window.location = "BondData.aspx";
}
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900