0

I'm having a a issue related to Sharepoint/ASP.Net Postbacks.

Basically, what's happening is I have the following GridView on my page:

 <SharePoint:SPGridView 
    EnableViewState="false" runat="server" 
    ID="gvSettings" 
    AutoGenerateColumns="false" 
    DataSourceID="MyObjectDataSource" 
    AllowGrouping="true" 
    GroupField="CategoryValue" 
    AllowGroupCollapse="true"
    AllowSorting="true" 
    AllowFiltering="true" 
    OnRowCommand="gvCurrentSettings_rowCommand"
     EnablePersistedSelection="true" EnableSortingAndPagingCallbacks="true">

Everything in the gridview works as it should. The problem is to do with the Paging controls. My Gridview has a SharePoint:MenuItemTemplate which opens a Modal Popup when you click to Edit an Item. The popup works fine.

Ever since i've gone and implemented Sorting on the Gridview the following happens:

  1. Clicking on a Column to sort by the column works fine.
  2. Next, clicking on the Menu and selecting edit opens up a Modal Popup.
  3. Clicking on a Save button inside the modal shows the Internet explorer message : "To display the web page again, the web browser needs to resend... " with the Retry, Cancel buttons. How can I avoid the double postback?
0

Ok, I figured it out. When refreshing a page after a modal is closed, do not use window.location.reload() Rather use window.location.href=window.location.href

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.