Note that there are some explanatory texts on larger screens.

plurals
  1. POstop jquery ui window from closing after postback
    primarykey
    data
    text
    <p>I have a jquery UI window that has a set of text boxes and an image uploader. ive got it up and running great, but am having an issue with the image uploader.</p> <p>When the user clicks to upload their image, the code fires ok, but returns after postback to the same page, but displayed as a flat page (i.e. no UI window and no styling).</p> <p>IM guessing that as the page has postback it knows nothing about its previous state. Apologies for the noob sort of question, I would normally be on MVC projects and could do this in my sleep lol.</p> <p>Can anyone offer any advice on what I may do. code:</p> <p>This loads the window from a grid:</p> <pre><code>$("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); } }); } }); </code></pre> <p>This is the HTML for the image uploader..</p> <pre><code> &lt;asp:FileUpload ID="editImage" runat="server" /&gt; &lt;asp:Button ID="btnUploadImage" Text="Upload" runat="server" OnClick="btnUploadImage_Click" /&gt; &lt;asp:Label ID="lblUpload" runat="server"&gt;&lt;/asp:Label&gt; </code></pre> <p>Code runs on the btnUploadImage:</p> <pre><code> protected void btnUploadImage_Click(object sender, EventArgs e) { if (editImage.HasFile) { try { .....code to upload sits here </code></pre> <p>Once the upload has executed I want to drop straight back to the UI window with the same state as before.. </p> <p>Any help greatly appreciated</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload