473,770 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<asp:HyperLin k> pop up message

Hi,

I need to display a small pop up message warning the user is leaving
the website. At the same time I need to also keep track of who is
leaving the website. My problem is that I can't user javascript in
asp:hyperlink tags. Should I just use a regular <atag and include the
IDs and Runat=Server tags?
Here is my code

<asp:HyperLin k ID="lnkTradeUp " runat="server" Target="_blank"
NavigateUrl="ht tp://www.google.com" onclick="javasc ript:ExitWebsit e()"
CssClass="Small ">Trade-Up FAQs</asp:HyperLink>

Oct 2 '06 #1
1 2181
You can use javascript: prefix in the NavigateUrl property as in
NavigateUrl="ja vascript:alert ('Me');"

Or from the code-behind add lnkTradeUp.Attr ibutes.Add ("onclick", "<JS code
goes here>");

"illmaginat ion" <he********@gma il.comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Hi,

I need to display a small pop up message warning the user is leaving
the website. At the same time I need to also keep track of who is
leaving the website. My problem is that I can't user javascript in
asp:hyperlink tags. Should I just use a regular <atag and include the
IDs and Runat=Server tags?
Here is my code

<asp:HyperLin k ID="lnkTradeUp " runat="server" Target="_blank"
NavigateUrl="ht tp://www.google.com" onclick="javasc ript:ExitWebsit e()"
CssClass="Small ">Trade-Up FAQs</asp:HyperLink>

Oct 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1293
by: Brandon Taylor | last post by:
Hi everyone, I'm using Visual Web Developer 2005 Beta, VB.NET I'm a complete newbie to .NET, and I'm working through some tutorials in ASP.NET for Dummies. When I add the NavigateURL="" parameter to my <asp:hyperlink> tags, the link will disappear completely when previewed in IE. If I remove the parameter, the link text will appear in IE, but no link. What am I doing wrong? I'd appreciate some help!
5
2103
by: Ken Dopierala Jr. | last post by:
Hi, This is just a query about what people use most. Up until today I've been using <asp:Table> tags to build my tables. We just outsourced our HTML design to a local guy and when I got it back today I was working with the html <table> <tr> <td> etc. What a difference that makes, server controls are even automatically declared in the code behind when using the generic HTML controls. I think I'm going to switch over to using them...
1
1210
by: Joo Park | last post by:
How do you have a hyperlink that will open up a new window which passes in selected items from a listbox that is on the same page as the hyperlink using <asp:Hyperlink>? thx in advance!
13
7448
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif" runat="server"></asp:imagebutton></A> When the user sees these buttons, they will currently be on the savings.aspx?category=whatever page, and when they click another button to look at other categories, all the links I have around these buttons direct to their various categories.
4
2218
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile" NavigateUrl="javascript:OpenImage('<%# DataBinder.Eval(Container.DataItem,"FileName") %>');"><%#
5
1227
by: newhorizon | last post by:
I am trying to let the users test if their web adresses are working or not. so they input their web adress and click a button and then the asp:hyperlink will point to their website. the problem is when they click asp:hyperlink points to http://www.mysite.com/myWorkingDirectory/www.userWebSite.com instead of www.userWebSite.com
0
1035
by: CharlesA | last post by:
I've got this onn the left of my datagrid <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" HeaderText="Edit" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn> and an ItemCommand event with switch (e.commandname) and even individual events for each command type (update, cancel etc..)
1
5747
by: rn5a | last post by:
Consider the following code: <script runat="server"> Sub Page_Load(obj As Object, ea As EventArgs) Dim sqlReader As SqlDataReader sqlReader = 'calling a function that returns SqlDataReader dlCart.DataSource = sqlReader dlCart.DataBind
1
5659
by: khalid sohail | last post by:
hi everybody i want to pass the window size parameter to <asp:hyperlink> attribute Navige URL Property. tell me how to pass the parameter to it.....actually i want to open the new window on the basis to the user click the data in the column i m passing the Query String also to opening page......i have done that work through the datagrid hyperlink column control but the problem was that i cant pass the Querystring to it so that why i m using...
0
9454
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
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
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
10038
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,...
1
7456
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
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.