how to put Button and ImageButton in Popup using jQuery in ASP.Net

Last Reply on Jun 05, 2017 04:44 AM By nedash

Posted on May 30, 2017 08:28 AM

hi refer belwo link


I want use popup that when users click on upload button it will show popup and in this popup I want put one imagebutton(imgload) and one fileupload control in above link it put just two button(yes No) in popup

how I can put popup with oneimagebutton and fileupload control?

Best regards




Posted on Jun 01, 2017 06:37 AM Modified on on Jun 01, 2017 06:39 AM

Hi nedash,

Please refer the below code and modify as per your requirement.

<form id="form1" runat="server">
<script type="text/javascript" src=""></script>
<script src="" type="text/javascript"></script>
<link href=""
    rel="stylesheet" type="text/css" />
<script type="text/javascript">
    $(function () {
            modal: true,
            autoOpen: false,
            title: "User Picture",
            width: 350,
            height: 260,
            buttons: [
        id: "Yes",
        text: "Yes",
        click: function () {
            $("[id*=btnUpload]").attr("rel", "Upload");
        id: "No",
        text: "No",
        click: function () {
        $("[id*=btnUpload]").click(function () {
            if ($(this).attr("rel") != "Upload") {
                return false;
            } else {
                __doPostBack(, '');
<asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="UploadRecord" UseSubmitBehavior="false" />
<div id="dialog" style="display: none" align="center">
    <asp:ImageButton ID="imgbutton" ImageUrl=""
        runat="server" />
    <br />
    <asp:FileUpload ID="UserPic" runat="server" />


protected void UploadRecord(object sender, EventArgs e)
    ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Picture Uploaded.')", true);

Protected Sub UploadRecord(sender As Object, e As EventArgs)
	ClientScript.RegisterStartupScript(Me.[GetType](), "alert", "alert('Picture Uploaded.')", True)
End Sub



Posted on Jun 05, 2017 04:44 AM

hi indresh

refer below site I use this modal popup it worked fine  thanks for your replay

best regards