hashim fajar
hashim fajar

Reputation: 19

print window is not showing

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

Answers (1)

Fenton
Fenton

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

Related Questions