?
Solved

Image button in a Repeater not firing event onclick

Posted on 2006-07-18
2
Medium Priority
?
698 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

777 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