How to open URL in new browser window
-
Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance
-
Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance
-
Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance
-
Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance
use
javascript:window.open('url')
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 -
Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance
-
Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance
Of course, when you're using a hyperlink or a linkbutton you can just set the target, and of course as others have mentioned, there's always javascript. That said, if you really need to use a button, or any other scenario where you want a new window to be fired up from an event handler in your code, this trick might be helpful. On your page (or on your master page) find the form by its ID:
HtmlForm frm = Page.FindControl("YourFormID") as HtmlForm; if (null != frm) { // this will cause the links to open in a new window frm.Target = "_blank"; }
Hope this helps -Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services