c# - can't set image url from onclick event -
i have problem setting image url image id
my button image is
<asp:imagebutton id="butim" runat="server" imageurl='<%# eval("image1") %>' commandargument='<%# eval("image1") %>' onclick="selectimage" width="100" height="100" />
this image button works correctly
my event
protected void selectimage(object sender, imageclickeventargs e) { string imagename = ((imagebutton)sender).commandargument; imgvw.imageurl = imagename; popimg.show(); }
my target popup
<ajaxtoolkit:modalpopupextender id="popimg" runat="server" popupcontrolid="panel1" backgroundcssclass="modalbackground" dropshadow="true" enabled="true" cancelcontrolid="cancel"> </ajaxtoolkit:modalpopupextender> <asp:panel id="panel1" runat="server" cssclass="modalpopup"> <asp:image id="imgvw" runat="server" /><br /> <asp:button id="cancel" runat="server" text="kembali" class="art-button" onclick="btncancel_click" /> </asp:panel>
my problem when set breakpoint on event, see url of imgvw.imageurl has right path can't display image. when input url manually on asp image id
<asp:image id="imgvw" imageurl="../image/image1.jpg" runat="server" />
popup can display image perfectly
can help me please?
c# asp.net url
No comments:
Post a Comment