|
-
Mar 26th, 2003, 05:52 PM
#1
Thread Starter
Addicted Member
ASP.NET/Javascript client events advice please
not an asp.net guy by trade but some advice would be great...
trying to extend the events of a asp.net control to include some javascript function onmouseover, onmouseout etc.
Now say i have a form with some controls and i want to add some generic events using the syntax
control.Attributes("onmouseout") = "m_over();"
(m_over being my own js function")
would it be a sensible measure to perform a loop through each control on my form and add the event as in this rough sample...
Code:
Dim ctr As Object
For Each ctr In Me.FindControl("Form1").Controls
ctr.attributes("onmouseover") = "m_over();"
Next
or is their a better way. All suggestins welcomed...
Cheers
-
Mar 27th, 2003, 02:42 AM
#2
Junior Member
hi,
i hope yr doubt is for adding event to web control. if yes, try this option to add client side event as
butDelete.Attributes.Add("onclick", "javascript: return test();")
where butDelete is web control(<asp:button ) and i am adding attribute to it (onclick) and test() is a javascript function.
bye
jasvinder
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|