Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Raising Custom Events

Status
Not open for further replies.

henna

Technical User
Dec 18, 2002
23
0
0
NZ
Hi,

I have a web page which dynamically creates some hyperlinks using the Response.Write("<a href='thispage.aspx?passData=12345'>some link</a>");.

Is it possible to or How can I add event handlers to these links after they have been rendered to the page.

Please help.
 
Give this a go, see how it goes.

:) -TAG

Code:
<%
response.Write "<script language=""vbscript"">" & vbcrlf
response.Write "Sub LinkHover" & vbcrlf
response.Write "alert(""You clicked on: "" & window.event.srcElement.id)" & vbcrlf
response.Write "End Sub" & vbcrlf
response.Write "</script>" & vbcrlf
response.Write "<a href=""thispage.aspx?passData=12345"" onmouseover=""vbscript:LinkHover"">some link</a>" & vbcrlf
%>

alien.gif

[Signature modified by admin request]
-TAG
anongod@hotmail.com
'Drawing on my fine command of language, I said nothing.'
 
thanks for the reply, I dont think I explained the question properly.
What I want to do is raise postback event when the link is clicked.
 
ah, i'm still not exactly sure what you need to do. If it's .net stuff check out this forum:

I'm not sure on the dynamic creation of an asp.net control.

gl
:) -TAG

alien.gif

[Signature modified by admin request]
-TAG
anongod@hotmail.com
'Drawing on my fine command of language, I said nothing.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top