Reputation: 19
My below asp.net server code is redirecting page without showing print window:
ScriptManager.RegisterStartupScript(this, typeof(Page), "printGrid", "javascript:window.print();", true);
Page.Response.Redirect(Page.Request.Url.ToString(), true);
Upvotes: 1
Views: 186
Reputation: 250842
If you add some JavaScript to the page and also redirect to another page, the JavaScript isn't going to execute.
Remove the redirect to allow the print dialog to open.
Upvotes: 1