asp:hyperlink control

  • Thread starter Thread starter francois
  • Start date Start date
F

francois

hi all,

I have hyperlink controld in my aspx webpage. When i click on it it needs to
open a new window, then i added the attribute target="_blank"

But I would like to also give a size to the new open window as well as take
off all the menu,link bars and other bars to have a minimalistic version of
internet explorer.

How can I achieve this? I assume i need to use some javascript but i did not
find a working script yet.

Best regards,

Francois
 
Hi,

you would need to pass a javascript 'window.open(...)' call to the href
attribute (or onclick attribute) the HyperLink renders. You can set this to
the NavigateUrl or by using Attributes collection.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

hi all,

I have hyperlink controld in my aspx webpage. When i click on it it needs to
open a new window, then i added the attribute target="_blank"

But I would like to also give a size to the new open window as well as take
off all the menu,link bars and other bars to have a minimalistic version of
internet explorer.

How can I achieve this? I assume i need to use some javascript but i did not
find a working script yet.

Best regards,

Francois
 
Hi Teemu,

Thank you for your information but I am quite beginner on the subject and I
am not sure how to pass the NavigateUrl attribute to the javascript as the
NavigateUrl is computed at page_load time during databinding to be more
exact ( i am using a repeater control )
If you have the code for it, it would be great or at least what kind of
techinque i can use

Best regards,

Francois
 
Hi,

you could see following article how to use JavaScript in conjuction with
ASP.NET

http://msdn.microsoft.com/asp.net/d.../en-us/dnaspp/html/aspnet-usingjavascript.asp

With this technique you just output a call to window.open, whihc open a
popup window for you. It allows you to specify the width and height of the
window and so on. And about the usage with repeater: you probably get these
measures for window (or parameters) while databinding? You would need to
access the HyperLink in ItemDataBound event of Repeater and from there set
the attributes of every repeateed (databound) HyperLink.

If you still have problem, perhaps you could show a sample how you are
databinding the repeater.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist



Hi Teemu,

Thank you for your information but I am quite beginner on the subject and I
am not sure how to pass the NavigateUrl attribute to the javascript as the
NavigateUrl is computed at page_load time during databinding to be more
exact ( i am using a repeater control )
If you have the code for it, it would be great or at least what kind of
techinque i can use

Best regards,

Francois
 
Back
Top