I try to open a popup window with JavaScript before redirecting to another page.
I’ve written this code:
ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "abc", "window.open('http://yahoo.com','2','resizable=yes,directories= no,menubar=no,top=null,left=00, width=100,height=100')", true);
Response.Redirect(p.Url);
but it is only a redirect and a popup does not open.
How do I open a popup window before the user user redirects to another page?
If you are doing anything like opening popup or window…before
response.redirect();, it will not work. If you want to redirect to any page after opening pop up boxes, please ensure that redirection should be written in Javascript only not in C#This will not work
This will work
OR
In this way we can call External JS files also