473,394 Members | 1,726 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,394 software developers and data experts.

<asp:HyperLink> 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:HyperLink ID="lnkTradeUp" runat="server" Target="_blank"
NavigateUrl="http://www.google.com" onclick="javascript:ExitWebsite()"
CssClass="Small">Trade-Up FAQs</asp:HyperLink>

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

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

"illmagination" <he********@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.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:HyperLink ID="lnkTradeUp" runat="server" Target="_blank"
NavigateUrl="http://www.google.com" onclick="javascript:ExitWebsite()"
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
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...
5
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...
1
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
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"...
4
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"...
5
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...
0
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...
1
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 ...
1
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...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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.