Hyperlink to open popup window?

O

Olav Tollefsen

I have an <asp:Hyperlink> in my .aspx file.

How can I configure it to open the URL (NavigateURL) in a popup window
instead of a new normal browser window. I use Target="_blank", but didn't
find other values to specify a popup window.

Olav
 
K

Kevin Spencer

One way is to use the target as you mentioned. You can also open a new
window using the JavaScript window.open() method, which gives you more
control over the properties of the window. If you want a hyperlink to
activate the JavaScript, you would use a URL as follows:

<a href="javascript:window.open('http://www.takempis.com')">Link Text</a>

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
O

Olav Tollefsen

Kevin Spencer said:
One way is to use the target as you mentioned. You can also open a new
window using the JavaScript window.open() method, which gives you more
control over the properties of the window. If you want a hyperlink to
activate the JavaScript, you would use a URL as follows:

<a href="javascript:window.open('http://www.takempis.com')">Link Text</a>

But, how do I get rid of the toolbar and address field stuff. I only want a
basic browser window to display some content.

Olav
 
O

Olav Tollefsen

Kevin Spencer said:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp

Thanks, do you have a hint to get the syntax correct when using it with a
DataSet:

<asp:HyperLink id=Hyperlink3 ForeColor="#555BAE"
NavigateUrl="javascript:window.open('<%# DataBinder.Eval(Container.DataItem,
"PhotoId", "DisplayPhoto.aspx?PhotoId={0}") %>')"
Runat="server'>L3_5</asp:HyperLink>

I get an error message "The server tag is not well formed".

How do I get the quotes right?

Olav
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top