Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Image button in a Repeater not firing event onclick

Posted on 2006-07-18
2
Medium Priority
?
699 Views
Last Modified: 2012-05-05
Why don't I get the ItemCommand event fired with the following:

                                                                        <asp:Repeater ID="rptMenubar" Runat=server>
      <ItemTemplate>
      <td>
      <asp:ImageButton ID=imgTest Runat=server CommandArgument=<%# Container.DataItem("Name")%> ImageUrl= <%# Container.DataItem("DefaultImage")%>></asp:ImageButton>
      </td>
      <td width=5 bgcolor="#d7ebf5"><span class="style3"></span></td>
      </ItemTemplate>
      </asp:Repeater>

Although clicking on the button causes a postback, it does not call the following event handler. Why?

 Private Sub rptMenubar_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles rptMenubar.ItemCommand

        Select Case e.CommandArgument

        End Select
    End Sub


0
Comment
Question by:WhiteEagle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
ibost earned 375 total points
ID: 17132425
I would think the likely reason is your repeater is getting rebuilt during postback... for instance you may be inadvertently rebinding the data.
0
 

Author Comment

by:WhiteEagle
ID: 17136571
If I use a link button instead of an image button it fires as expected, which wouldn't happen if the repeater is being rebuilt.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question