0

Within the solution there are two webparts, second is being shown within a modal dialog in first webpart.

In second webpart everything is inside update panel(bad practice). When I open the second webpart first time and perform any postback(either by button click or dropdown index change)

Page.IsPostBack is true and ScriptManager.GetCurrent(Page).IsInAsyncPostBack is also true (Which is good because within page load I have added check for these two condition)

but when I keep the modal popup static for lets say 3 minutes and then perform any postback operation both the Page.IsPostBack and ScriptManager.GetCurrent(Page).IsInAsyncPostBack are false hence instead of firing the event handler for the control causing the postback the whole page within the modal refreshes.

Update panel is used like this

<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
....contents
</ContentTemplate>
</asp:UpdatePanel

Triggers are not used. tried these attribute as well

ChildrenAsTriggers="true" UpdateMode="Conditional"

still the same behavior

2

As it turns out this was the problem with SharePoint 2013 and update panel You can read about the exact problem and available workarounds in the following technet forum:

https://social.technet.microsoft.com/Forums/systemcenter/en-US/c33d4a46-87d6-4dbc-a24c-cb8e5f9eb1ea/page-refresh-after-postback-from-updatepanel-in-sharepoint-2013?forum=sharepointdevelopment

among the multiple workaround suggested the one works for me is the following script:

ExecuteOrDelayUntilBodyLoaded(function () {
    try {
        if (Sys.WebForms.PageRequestManager.getInstance().digestFixed !== true) {
            Sys.WebForms.PageRequestManager.getInstance().digestFixed = true;
            Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(function () {
                if (typeof (UpdateFormDigest) === "function" && typeof (_spPageContextInfo) === "object")
                    UpdateFormDigest(_spPageContextInfo.webServerRelativeUrl, 3 * 60 * 1000);
            });
        }
    }
    catch (e) { }
});

Thanks @Shai Petel (From the forum)

| improve this answer | |
  • If there is a possibility, we can disable the form authentication for the web application, that also resolves the issue. – user4205 Nov 13 '15 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.