How to display image in popup on Button click event?
Display Image in popup on button click Event.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Dec 22, 2014, 12:27 AM EST
.aspx file:
CancelControlID="btnClose" BackgroundCssClass="modalBackground"> </cc1:modalpopupextender> <asp:panel id="Panel1" runat="server" cssclass="modalPopup" align="center" style="display:none" xmlns:asp="#unknown"> This is an ASP.Net AJAX ModalPopupExtender Example <asp:image id="img1" runat="server"> ImageUrl='~/Image/abc.jpg'></asp:image> <asp:button id="btnClose" runat="server" text="Close" /> </asp:panel>
.aspx.cs file: (Button Click Event)
void Btn_Click(Object sender, EventArgs e)
{
mp1.show(); // Model popup id .show function is to open poup on button click event
}
Dhruvi kukadiya18 reputationPosted Dec 22, 2014, 6:01 PM EST
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Dec 22, 2014, 6:10 PM EST
Modify the above code you can do that also. Assign image path dynamically then it will work.