0

I am using fancybox to create a modal where the user searches for some information they want to link back to their profile. Once they click save, the database is updated with this linkage and the UpdatePanel should be updated to reflect the change. At present, the entirety of the page reloads, instead of just a partial.

Here is what I have for the fancybox afterclose function:

$(".iframefancy").fancybox({
            width: '690',
            closeBtn: true,
            preload: true,
            helpers: {
                overlay: {
                    closeClick: false
                }
            },
            afterClose: function () {
                __doPostBack('indpnl', '');
            }
        });

UpdatePanel is as follows. "btnnewcontact" is the button in the modal that saves the data to the database.

    <asp:UpdatePanel runat="server" ID="indpnl">
       ...listview here containing the profile...
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnnewcontact" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>

It seems like I must be missing something in the page lifecycle.

fcholmes
  • 41
  • 1
  • 11
  • Where is `UpdatePanel` actually handled here? – Derple Nov 08 '15 at 04:07
  • __doPostBack('indpnl', ''); should be reloading the update panel. – fcholmes Nov 08 '15 at 04:09
  • Are you opening the page in an actual iframe? (don't see the `type:"iframe"` API option in your code) Could you share the html code that triggers fancybox? If you want to pass data from parent to iframe back and forth check http://stackoverflow.com/a/26446330/1055987 if that helps (just make sure you understand what `iframe` means, which is not the same as `modal` ;) – JFK Nov 08 '15 at 23:50
  • @JFK You are absolutely right. I've been going round and round and confused myself. Question updated accordingly. – fcholmes Nov 09 '15 at 03:27

0 Answers0