Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 29, 2012 12:52 PM by Shoaib.Rashid
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 } }
All-Star
95503 Points
14106 Posts
Apr 29, 2012 10:17 AM|LINK
Try by putting Repeater inside UpdatePanel....
Thanks,
Apr 29, 2012 10:20 AM|LINK
If put the repeater inside updatepanel, the entire repeater will be update. As a result, all image will refersh as well =(
130 Points
41 Posts
Apr 29, 2012 12:52 PM|LINK
You must have to keep repeater inside of updatepanel'
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 } }ramiramilu
All-Star
95503 Points
14106 Posts
Re: Image button clicked without refresh image
Apr 29, 2012 10:17 AM|LINK
Try by putting Repeater inside UpdatePanel....
Thanks,
JumpStart
My2ndLovE
Member
57 Points
99 Posts
Re: Image button clicked without refresh image
Apr 29, 2012 10:20 AM|LINK
Hi,
If put the repeater inside updatepanel, the entire repeater will be update. As a result, all image will refersh as well =(
Shoaib.Rashi...
Member
130 Points
41 Posts
Re: Image button clicked without refresh image
Apr 29, 2012 12:52 PM|LINK
You must have to keep repeater inside of updatepanel'