troubleshooting Question

How to perform both a server and client side events with an ASP.NET ImageButton

Avatar of pmodiano1
pmodiano1 asked on
ASP.NETJavaScript
7 Comments1 Solution414 ViewsLast Modified:
Hi,

I have an ImageButton inside a repeater.  When the repeater loads these buttons are visible and are in the same position as a flash media player, which is not visible.  The repeater's ItemDatabound looks like this:

    Protected Sub catlist_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles catlist.ItemDataBound
        Dim ListenButton As ImageButton
        Dim FlashPlayer As Panel
        ListenButton = CType(e.Item.FindControl("ListenButton"), ImageButton)
        FlashPlayer = CType(e.Item.FindControl("FlashPlayer"), Panel)
        If (Not ListenButton Is Nothing) Then
            ListenButton.Attributes.Add("onclick", "document.getElementById('" & FlashPlayer.ClientID & "').style.visibility = 'visible'; document.getElementById('" & ListenButton.ClientID & "').style.visibility = 'hidden'; return false;")
        End If
    End Sub

Now, a new requirement has been introduced that requires me to perform a server side event as well but because the OnClick attribute is being added dynamically, I cannot seem to find a way to trigger a server side event while at the same time maintaining the current client side functionality.

Any ideas?

Thanks,

Paul.
ASKER CERTIFIED SOLUTION
Gorkem Yuksel
Director, IT Development

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros