473,659 Members | 2,886 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling a Javascript Function using Anchor tag in ASP.net

88 New Member
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 6451
Plater
7,872 Recognized Expert Expert
have you tried:
Expand|Select|Wrap|Line Numbers
  1. ht1.RenderBeginTag("a href=\"javascript:openWin('" + a + "')\"");
  2.  
?
Jan 3 '08 #2
ravitunk
88 New Member
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:ope nWin()".....and the content of the page is page cannot be displayed..plea se 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 Recognized Expert Expert
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
3306
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 href="javascript:this.style.textDecorationLineThrough">text here</a> to no avail. does anyone have an idea on how to do this?
3
14149
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
4325
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
12983
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 onMouseOver="ShowMenu('Menu3');AddMenuToHoldArray('Menu3')">Menu 3</a>
2
2215
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 hitting of the enter key was to simply not have a submit button, instead going for a regular anchor which calls a javascript confirmation box and then submits the form.
9
2109
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 and Safari, but in the latest FireFox I get no title or article, but do see the prev and next links and the article number. My HTML and JS simple routine is as follows:
5
25845
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 function...if that makes sense. Here's what I mean... I have a javascript array set up like so: <script language="javascript" TYPE="text/JavaScript"> //custom object constructor
18
12675
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 state, the HTML page URL would change from default.html to default.html#stateA. example: http://pearstudios.com/javascript/locationHashAndFlash.html This has worked perfectly within HTML and javascript alone, however, when connecting Flash and...
5
1710
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 part of the code. Thanks In the class file: public void DataGrid2_Edit(Object sender, DataGridCommandEventArgs e) { DataGrid2.EditItemIndex = (int)e.Item.ItemIndex; BindGrid();
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8525
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2750
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.