asp.net - stop jquery ui window from closing after postback -


i have jquery ui window has set of text boxes , image uploader. ive got , running great, having issue image uploader.

when user clicks upload image, code fires ok, returns after postback same page, displayed flat page (i.e. no ui window , no styling).

im guessing page has postback knows nothing previous state. apologies noob sort of question, on mvc projects , in sleep lol.

can offer advice on may do. code:

this loads window grid:

$("a[name^='editsection_']").on("click", function (e) {     e.preventdefault();      var id = $(this).data("id");     var divdiag = $("#addedit");       $.ajax({         url: "/edit.aspx?id=" + id,         success: function (data) {             $(divdiag).html(data);             $(divdiag).dialog({                 show: { effect: 'drop', direction: "up" },                 title: "editing feature box",                 height: 800,                 width: 740,                 modal: true,                 resizable: false,                 option: "show",                 close: function (ev, ui) {                     window.location.reload(true);                 }             });         },         error: function (data) {             $(divdiag).html(data);             $(divdiag).dialog({                  show: { effect: 'drop', direction: "up" },                 title: "editing feature box",                 height: 800,                 width: 740,                 modal: true,                 resizable: false,                 option: "show",                 close: function (ev, ui) {                     window.location.reload(true);                 }             });         }     }); 

this html image uploader..

        <asp:fileupload id="editimage" runat="server" />         <asp:button id="btnuploadimage" text="upload" runat="server" onclick="btnuploadimage_click" />         <asp:label id="lblupload" runat="server"></asp:label> 

code runs on btnuploadimage:

    protected void btnuploadimage_click(object sender, eventargs e)     {         if (editimage.hasfile)         {             try             {     .....code upload sits here  

once upload has executed want drop straight ui window same state before..

any appreciated

if in jquery use following jquery components have customize solution

dropzonejs


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -