Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i used ClientScript.RegisterStartupScript(GetType(), null, "window.open('PdfReport.aspx');", true);.initially it was working,, but when i added session variable.. this code stopped working..
here is the code:
C#
{
Session["PostedStatus"] = "Record Posted Successfully !!!";
ClientScript.RegisterStartupScript(GetType(), null, "window.open('PdfReport.aspx');", true);
}
 Response.Redirect("MainMenu.aspx");



is session preventing execution of ClientScript?? any help
Posted

C#
{
Session["PostedStatus"] = "Record Posted Successfully !!!";
ClientScript.RegisterStartupScript(GetType(), null, "window.open('PdfReport.aspx');", true);
}
 Response.Redirect("MainMenu.aspx"); // this line will redirect to the next page ,so the javascript wont execute...
 
Share this answer
 
Comments
King Fisher 31-Jan-14 5:51am    
my +5,its clear
Karthik_Mahalingam 31-Jan-14 6:00am    
Thanks King_Fisher :)
thanks karthik.. as per your comment.. i added location.replace in javascript code insted of response.redirect and its working,, thanks a lot
 
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