Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?
share|improve this question
    
how are you binding grid? –  Prashant Lakhlani Apr 10 '13 at 11:58

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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