469,960 Members | 2,016 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,960 developers. It's quick & easy.

Calling a Javascript Function using Anchor tag in ASP.net

hi..i have a javascript function which uses window.open() function to open another window... as below...
Expand|Select|Wrap|Line Numbers
  1. <script language ="JavaScript"> 
  2. function openWin(url)
  3.  { 
  4.    window.open(url,"composerwindow","toolbar=no,width=350,height=400,status=no,scrollbars=yes,resize=no,menubar=no"); 
  5.  } 
  6. </script>

my ASP.net application sends an email which has a link. If the user clicks on the link then the javascript function is called....but am unable to do so...

ASP.net Code is as follows....
Expand|Select|Wrap|Line Numbers
  1.  a = http://localhost:7899/folder1/newfile.aspx; 
Expand|Select|Wrap|Line Numbers
  1.  ht1.RenderBeginTag("a href=javascript:openWin('" + a + "')");
  2.           ht1.RenderBeginTag("P");
  3.           ht1.WriteLine("Click Here");
  4.           ht1.RenderEndTag();
  5.           ht1.RenderEndTag(); 
  6.  

am unable to call a javascript function using Anchor tag(as detailed above)...Can u please suggest me an approach to accomplish it...thanks for any help...
Jan 3 '08 #1
3 6072
Plater
7,872 Expert 4TB
have you tried:
Expand|Select|Wrap|Line Numbers
  1. ht1.RenderBeginTag("a href=\"javascript:openWin('" + a + "')\"");
  2.  
?
Jan 3 '08 #2
hi thx for ur reply....I tried that way but dint work....as soon as i click the link in the mail..its opening up a new window and the address line has "javascript:openWin()".....and the content of the page is page cannot be displayed..please help me out if u have any idea..thx...


have you tried:
Expand|Select|Wrap|Line Numbers
  1. ht1.RenderBeginTag("a href=\"javascript:openWin('" + a + "')\"");
  2.  
?
Jan 4 '08 #3
Plater
7,872 Expert 4TB
I don't believe emails support javascript? They render html, but that's about it.
Although I suppose it's limited to the capabilities of the emailclient.
don't think any of them support javascript.
Jan 4 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by bigbinc | last post: by
10 posts views Thread by reynoldscraigr | last post: by
2 posts views Thread by Greg T | last post: by
9 posts views Thread by Astra | last post: by
5 posts views Thread by elsenraat_76 | last post: by
5 posts views Thread by srini.venkatesan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.