I am showing aspx page(Add Item form) inside jquery modal, whenever I upload an image the page refreshes and loads as a normal webpage <p>I have 2 files :- </p> <ol> <li>Items.aspx with the list of items in a grid view, A button(to open a form for adding new item), and a div with id testing.</li> </ol> <p>code Inside Items.aspx</p> <pre><code> &lt;%@ Page Title="" Language="C#" MasterPageFile="~/Basic.Master" AutoEventWireup="true" CodeBehind="Items.aspx.cs" Inherits="FlowerShopAdminPanel.Items" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content2" ContentPlaceHolderID="header" runat="server"&gt; &lt;div id="dvGrid" class="container"&gt; &lt;!-- This contains the gridview --&gt; &lt;/div&gt; &lt;div id="testing"&gt;&lt;/div&gt; &lt;script&gt; function openDialog($itemid,$categoryid) { $('#testing').dialog({ modal: true, dialogClass: "no-close", open: function () { $(this).load('AddItem.aspx?itemid=' + $itemid+'&amp;categoryid='+$categoryid); $(".ui-dialog-titlebar-close", ui.dialog | ui).hide(); }, height: 500, width: 500, title: 'Add Item' }); } &lt;/script&gt; &lt;style&gt; .image { height: 30vh; } .no-close .ui-dialog-titlebar-close { display: none; } &lt;/style&gt; &lt;/asp:Content&gt; </code></pre> <p>This loads a form to add item in a jquery modal. we can upload image to that item using a Button . Above function is on another aspx form in which I am </p> <ol start="2"> <li><p>AddItem.aspx</p> <p></p> <p> </p> <pre><code> &lt;div&gt; &lt;asp:Label runat="server" Text="Category Name"&gt;&lt;/asp:Label&gt; &lt;asp:DropDownList runat="server" ID="category_ddl"&gt;&lt;/asp:DropDownList&gt; &lt;/div&gt; &lt;div&gt; &lt;asp:Label runat="server" Text="Item Name"&gt; &lt;/asp:Label&gt; &lt;asp:TextBox runat="server" ID="itemname_txt"&gt;&lt;/asp:TextBox&gt; &lt;/div&gt; &lt;div&gt; &lt;asp:Label runat="server" Text="Description"&gt;&lt;/asp:Label&gt; &lt;asp:TextBox runat="server" TextMode="MultiLine" Rows="5" Columns="50" ID="description_txt"&gt;&lt;/asp:TextBox&gt; &lt;/div&gt; &lt;div&gt; &lt;asp:Label runat="server" Text="Main Image"&gt;&lt;/asp:Label&gt; &lt;asp:FileUpload runat="server" ID="mainimage_fileupload"/&gt;&lt;br /&gt; &lt;asp:Image runat="server" ID="mainimage_img" Visible="false" /&gt; &lt;asp:Button runat="server" ID="fileupload_btn" Text="Upload" OnClick="fileupload_btn_Click" /&gt; &lt;asp:Label runat="server" ID="filename_lbl" Visible="false" ForeColor="Red" Font-Bold="true"&gt;&lt;/asp:Label&gt; &lt;/div&gt; &lt;div&gt; &lt;asp:Label runat="server" Text="Active"&gt; &lt;/asp:Label&gt; &lt;asp:CheckBox runat="server" ID="isActive_chk"/&gt; &lt;/div&gt; &lt;div&gt; &lt;asp:Button runat="server" ID="addItem_btn" Text="Add Item" OnClick="addItem_btn_Click"/&gt; &lt;asp:Button runat="server" ID="cancel_btn" Text="Cancel" OnClick="cancel_btn_Click"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p> </p></li> </ol> <p>Whenever I upload the image it opens up as a normal aspx page. Basically, Whenever the aspx page is refreshed, it opens up as a normal web page. I always want to open it in the jQuery modal.</p> <p>Please help in resolving this issue. </p> <p>Thank you</p>