Syntax for hyperlink window.open

S

susie

I need to open a new blank page with specification in
NavigateUrl as below. The following syntax is wrong.
1.What is the correct syntax?
2.How to specify the target window in asp:hyperlink tag?

<asp:hyperlink text="link"
NavigateUrl="javascript:window.open
('http://web/Camelot/appDetail.aspx?
id='&tAppID,'', 'toolbar=no,location=no,
directories=no,status=no,resizable=no,width=400,
height=400'); void('');" runat="server"/>


Thank you very much!
 
A

Alessandro Zifiglio

You can use the target attribute of the hyperlink control. target="_blank"
opens in a new window, and your using plain html whereas to using scripts ;)

However if you need control over the dimentions of your window etc, you
could just call a function, that way if you had other links that needed the
popup, you just need to keep calling that same function.

<asp:hyperlink text="link"
NavigateUrl="javascript:popMeUp('http://web/Camelot/appDetail.aspx?id=&tAppI
D')" runat="server"></asp:hyperlink>

<script type="text/javascript">
//<![CDATA[
function PopMeUp(theUrl){
window.open(theUrl,'stuff','toolbar=no,location=no,directories=no,status=no,
menubar=no,scrollbars=yes,resizable=no,width=400,height=400,top=100,left=100
')
}
//]]>
</script>
 
A

Alessandro Zifiglio

Alessandro Zifiglio said:
You can use the target attribute of the hyperlink control. target="_blank"
opens in a new window, and your using plain html whereas to using scripts ;)

However if you need control over the dimentions of your window etc, you
could just call a function, that way if you had other links that needed the
popup, you just need to keep calling that same function.

<asp:hyperlink text="link"
NavigateUrl="javascript:popMeUp('http://web/Camelot/appDetail.aspx?id=&tAppI
D')" runat="server"></asp:hyperlink>

<script type="text/javascript">
//<![CDATA[
function PopMeUp(theUrl){
window.open(theUrl,'stuff','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,height=400,top=100,left=100
')
}
//]]>
</script>

susie said:
I need to open a new blank page with specification in
NavigateUrl as below. The following syntax is wrong.
1.What is the correct syntax?
2.How to specify the target window in asp:hyperlink tag?

<asp:hyperlink text="link"
NavigateUrl="javascript:window.open
('http://web/Camelot/appDetail.aspx?
id='&tAppID,'', 'toolbar=no,location=no,
directories=no,status=no,resizable=no,width=400,
height=400'); void('');" runat="server"/>


Thank you very much!
 
A

Alessandro Zifiglio

a correction, I see you have an ampersand in there, replace that with a plus
sign : + that is id=+AppID


Alessandro Zifiglio said:
You can use the target attribute of the hyperlink control. target="_blank"
opens in a new window, and your using plain html whereas to using scripts ;)

However if you need control over the dimentions of your window etc, you
could just call a function, that way if you had other links that needed the
popup, you just need to keep calling that same function.

<asp:hyperlink text="link"
NavigateUrl="javascript:popMeUp('http://web/Camelot/appDetail.aspx?id=&tAppI
D')" runat="server"></asp:hyperlink>

<script type="text/javascript">
//<![CDATA[
function PopMeUp(theUrl){
window.open(theUrl,'stuff','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,height=400,top=100,left=100
')
}
//]]>
</script>

susie said:
I need to open a new blank page with specification in
NavigateUrl as below. The following syntax is wrong.
1.What is the correct syntax?
2.How to specify the target window in asp:hyperlink tag?

<asp:hyperlink text="link"
NavigateUrl="javascript:window.open
('http://web/Camelot/appDetail.aspx?
id='&tAppID,'', 'toolbar=no,location=no,
directories=no,status=no,resizable=no,width=400,
height=400'); void('');" runat="server"/>


Thank you very much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,084
Messages
2,570,596
Members
47,217
Latest member
GuadalupeE

Latest Threads

Top