Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.open equivalent in .NET

Status
Not open for further replies.

jmerencilla

Programmer
Jul 17, 2002
123
SG
hi. would you guys know the "window.open()" equivalent in .NET? thanks. :)
 
There is no equivalent to "window.open()" in .NET, except for the Response.Redirect("new_page.aspx", false).
If u say the current page hasn't finished processing, it opens the new page on a new window.

Sometimes it's a better choice to include client code on your page, to do things ASP.NET doesn't allow, or allows with little or no control. NetAngel
 
jmerincilla:

if you want your asp.net controls to perform a window.open, but you don't want to be adding code in both the code behind and the html view of the designer, just do this:

Around the top of the code behind, there is a region called Web Form Generated Code (or something like that). Within it, there is an Initialize sub. Here you can do something like:

MyButton.Attributes.Add("onClick","window.open()")

When the page renders, it will autotmatically embed the client script into the html for you.

you still are using the client script, but just coding it in one spot.

hth

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top