New window should open in another browser
-
Hi Team, I am having problem with window. I am having one path I am taking in String. On button click I am calling Response.Redirect (str) where str=path of the url. I need to open the url in another browser how to do this? Thanks in Advance
-
Hi Team, I am having problem with window. I am having one path I am taking in String. On button click I am calling Response.Redirect (str) where str=path of the url. I need to open the url in another browser how to do this? Thanks in Advance
To open in a new browser window, you should use
window.open
rather thanResponse.Redirect
. Response.Redirect works in Server side, so it just replaces the url you called with the url you redirect for. If you want this to open in a new window, either write a javascript block element in the button_click (You might usethis.ClientScript.RegisterStartupScript
) from the server, or you may use javascript directly from the client to open in a new window and call the url from the new window usingonclick="javascript:window.open('url.aspx','');"
like this. Cheers. :rose:Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
To open in a new browser window, you should use
window.open
rather thanResponse.Redirect
. Response.Redirect works in Server side, so it just replaces the url you called with the url you redirect for. If you want this to open in a new window, either write a javascript block element in the button_click (You might usethis.ClientScript.RegisterStartupScript
) from the server, or you may use javascript directly from the client to open in a new window and call the url from the new window usingonclick="javascript:window.open('url.aspx','');"
like this. Cheers. :rose:Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascriptuse the following code to open a new window
window.open('pagename.aspx', '_blank');
If you want to open a window with specific size then use window.open('Pagename.aspx', 'Help', config = 'height=800,width=1013,left=' + left + ', toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, directories=no, status=no'); :)
Pankaj