Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
57 Points
99 Posts
Apr 29, 2012 10:09 AM|LINK
Hi,
I have a image button inside a repeater, i need to execute ItemCommand event to get the image ID.
The only condition is, i don't want to refresh the image. Therefore i place an update panel inside the repeater.
But the particular image that i click will still refresh
Any way to make it fire the ItemCommand event (click on the image) without refresh the image?
<asp:Repeater ID="rptChildItem" runat="server" onitemcommand="rptChildItem_ItemCommand" DataSourceID="dsPictures"> <ItemTemplate> <asp:UpdatePanel ID="upChildItem" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:ImageButton ID="imgChildItemURL" runat="server" ImageUrl='<%# Eval("PicturesURL").ToString() %>' CommandName="select"/> </ContentTemplate></asp:UpdatePanel> </ItemTemplate></asp:Repeater>
protected void rptChildItem_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "select") { //get image ID } }
My2ndLovE
Member
57 Points
99 Posts
Image button clicked without refresh image
Apr 29, 2012 10:09 AM|LINK
Hi,
I have a image button inside a repeater, i need to execute ItemCommand event to get the image ID.
The only condition is, i don't want to refresh the image. Therefore i place an update panel inside the repeater.
But the particular image that i click will still refresh
Any way to make it fire the ItemCommand event (click on the image) without refresh the image?
<asp:Repeater ID="rptChildItem" runat="server" onitemcommand="rptChildItem_ItemCommand" DataSourceID="dsPictures"> <ItemTemplate> <asp:UpdatePanel ID="upChildItem" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:ImageButton ID="imgChildItemURL" runat="server" ImageUrl='<%# Eval("PicturesURL").ToString() %>' CommandName="select"/> </ContentTemplate></asp:UpdatePanel> </ItemTemplate></asp:Repeater>protected void rptChildItem_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "select") { //get image ID } }