Opened 9 years ago
Closed 9 years ago
#9706 closed bug (worksforme)
appendTo not working with close event
Reported by: | Eneuman | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.dialog | Version: | 1.10.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I'm using asp.net 4.0 with ajax. I'm using appenTo option to attach the dialog to my form. AJAX is working fine from within the dialog but if I do a ajax postback, when the dialog is closing, the hole page gets refreshed, not just the update panel containing my lbAterstallAvslutaArende link button. This used to work in 1.9.1
To me It seems like the close event is working "outside" of the appendTo context, and thats why MS Ajax cannot find any updatepanel to update.
My code that's failing:
$("#AvslutaArende").dialog({ autoOpen: false, appendTo: "#aspnetForm", height: 400, width: 800, modal: true, title: "Avsluta ärende", close: function(event, ui) { <% =Page.ClientScript.GetPostBackEventReference(lbAterstallAvslutaArende, "") %> } });
<asp:UpdatePanel runat="server" ID="upAterstallAvslutaArende" UpdateMode="Conditional"> <ContentTemplate> <asp:LinkButton runat="server" ID="lbAterstallAvslutaArende" OnClick="lbAterstallAvslutaArende_OnClick"/> </ContentTemplate> </asp:UpdatePanel>
Change History (2)
comment:2 Changed 9 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Here's a demo showing that the dialog is still in the correct position at the time of the close
event: http://jsbin.com/ekiYaDOP/1/edit
Since postbacks are .NET-specific, we'll need a reduced test case that doesn't use .NET which shows the problem you're trying to describe. I'm going to close this since the jsbin shows that this is working properly. If you can provide a reduced test case showing a problem inside jQuery UI, we'll reopen. But it sounds like you'll need .NET help, not jQuery UI help.
Doing a postback works fine as long as I don't do it from the close event:
This works:
and this works:
But this is not working: