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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup Windows

Status
Not open for further replies.

MrShagadelic

Programmer
Feb 12, 2001
15
0
0
US
I'm developing a business app using ASP.Net (vb.net in the code behind) and I want to add a hyperlink that will popup a new window. I can get it to work with a button but I'd rather use a hyperlink. I know it can be done b/c I've seen sites that do it, but I can't get to the code behind to figure it out. Any ideas?
 
NoCoolHandle -

That definitely opens a new window however I'd like the user to click on the hyperlink and have a popup window. I'm using the following code on the OnClick event:

function PopUpWindow(strURL) {
window.navigate = false;
window.open(strURL,'','toolbar=no,menubar=no,location=no,height=500;width=250');
}

I've got the target set to _blank and the popup window works fine, however the target=_blank brings up another popup window with nothing in it. Any insight?

Thanks,
MrShagadelic
 
Shag --

Here's a bit of java I routinely use to open up a popup window (sending a QS variable):

Code:
function openWin(strVar){
var strPg; 
var strCondit ="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,minimize=no,copyhistory=no,width=565,height=540,left=40,top=120"
  strPg = "MyPage.aspx?myVar=" + strVar
  myWindow = window.open(strPg, 'newWin3', strCondit)
}

You can add a call to this function directly in the hyperlink:

Code:
<a href="javascript:openWin('<%=strVar%>')">My Hyperlink</a>

..so not directly involved with code behind, all clientside.
 
Isadore,
I figured it out yesterday but I did exactly what you described. Thanks for the help!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top