[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3502
  • Last Modified:

hyperlink: Open new window in vb.NET

hello:

im using hyperlink control and when the user clicks on the hyperlink i want to open a new popup window with all the properities of the window like height, width....

thanks.
0
service2001
Asked:
service2001
  • 3
  • 2
1 Solution
 
service2001Author Commented:
i use this code but it does not give me hyperlink:

 HyperLink1.NavigateUrl = "javascript:var w=window.open('TestPage.aspx','', 'width=625,height=760,scrollbars=yes,resizeable=yes');"
0
 
gtmljscCommented:
I suggest you use a LinkButton instead, then in the click event of the link button, add the following:

Response.Write("<script>window.open('Testpage.aspx','testWindow','width=625,height=760,scrollbars=yes,resizeable=yes')</script>")
0
 
service2001Author Commented:
i can not use linkbutton its a requirement to use only hyperlink
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
platinumbayCommented:
You could build a WebCustomControl, inherit from the hyperlink control, and then use AddAttributesToRender to add javascript to the start 'a' tag.  You'd still be 'using' the Hyperlink Control.  Sounds like a school project?
0
 
service2001Author Commented:
is it so difficult? oh man
0
 
platinumbayCommented:
This PAQd item has some sample code for a WebCustomControl.  You should look through it, it's pretty self-explanitory, and it might just do the trick.  Basically, I would inherit from the Hyperlink control, and use the Click event handler.

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21216605.html#12651739
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now