Results 1 to 2 of 2

Thread: ASP.NET/Javascript client events advice please

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2002
    Location
    closed
    Posts
    196

    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

  2. #2
    Junior Member
    Join Date
    Dec 2002
    Location
    India
    Posts
    27
    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
  •  



Click Here to Expand Forum to Full Width