473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 6442
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

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

Similar topics

6
by: mary zelinski | last post by:
I have a word bank for a javascript crossword puzzle I'm working on. What I want to do is when a user clicks on a word in the word bank, it crosses itself out. I have tried: <a...
3
by: bigbinc | last post by:
set scroll position in javascript. Is there a way to do this without using document.location, example. document.location = "#gohere" <a name="gohere">
1
by: Christian Radermacher | last post by:
Hi, the following code has the mentioned behaviour: <html> <head> <script type="text/javascript"> function newA() { for (i=0;i<3;i++) { var a = window.frames.document.createElement("a");
10
by: reynoldscraigr | last post by:
Hi All, I am trying to call 2 functions from the 1 onMouseOver event on an anchor tag, but I can't seem to get it to work. the following should demonstrate <a...
2
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of...
9
by: Astra | last post by:
Hi everybody Wonder if you could help me out. I created a simple JavaScript routine to enable a user to click backwards and forwards between small news articles. This routine works fine in IE...
5
by: elsenraat_76 | last post by:
Hello! I was wondering if someone could help me out with a problem I'm having? I'm trying to input a javascript value into an anchor tag (from a function), but don't have an event to call the...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
5
by: srini.venkatesan | last post by:
I am trying to call a javascript from Datagrid which is using OnUpdatecommand, I dont see update being invoked, what am I missing, Is it the right way to call. I have just cut and pasted only the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.