Note that there are some explanatory texts on larger screens.

plurals
  1. POGridview inside UpdatePanel, paging/sorting doesn't work ONLY when using MasterPage
    primarykey
    data
    text
    <p>Another gridview in updatepanel paging/sorting questions folks.</p> <p>Gridview looks like this:</p> <pre><code>&lt;asp:UpdatePanel runat="server" ID="upGdvPendingReview" ChildrenAsTriggers="true" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:GridView ID="gdvPendingReview" runat="server" PageSize="10" AllowPaging="true" AllowSorting="true" &gt; &lt;columnCrudHere&gt; &lt;/asp:GridView&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>Gridview is bound to linqdatasource using the Selecting event. This code works perfectly without the updatepanel. It also works perfectly if I copy to a page that isn't a Content Page to a Master Page. I've read a lot of posts about gridview issues in update panels with paging and sorting. In fact, there is one where they guy comments at the end that he got it working but it still fails when using a MasterPage. I've tried using a scriptmanager in the same page as the gridview and changing various options of the scriptmanager. To get it working, I just create a new page, copy my gridview, linqdatasource, scriptmanager, and code behind...and boom it works. It makes me wonder if I have something else in the page getting in the way. I do have other updatepanels where I can update content fine. So, this...combined with the post where the same issue is mentioned briefly has me perplexed. </p> <p>I've also tried explicitly listing the event:</p> <pre><code>&lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="gdvPendingReview" EventName="PageIndexChanging" /&gt; &lt;/Triggers&gt; </code></pre> <p>Here is the post where it seems like someone is having the same issue (at the very end): <a href="https://stackoverflow.com/questions/18918008/gridview-paging-inside-updatepanel-does-not-work-for-second-page-change-why">GridView PAGING inside UpdatePanel does not work for second page change, why?</a></p> <p>***Update</p> <p>As I continue to test this, it becomes more frustrating and fascinating. I have created two new pages with only the gridview, linqdatasource, scriptmanager, and databinding methods. One page has no master....the other page has a master (but a completely new and clean one to avoid any possible interference). Same results! Paging/Sorting works great asynchronously as long as I'm not referring to a master page. :(</p> <p>***Update</p> <p>I should admit that I am a liar. The test page I set up (with Master) did have some code left over from a previous test. In fact, when I comment this code out, my GridView paging works inside the UpdatePanel when using a MasterPage. The culprit? A "Response.Write". When I toggle this off an on I can create the issue on demand. Big lesson "Relearned" here about testing and not assuming anything. There is still some mystery, though.</p> <p>Interestingly, I don't have a Response.Write or anything I can find in my code for the original page with the issue. Does anyone have a thought on why the "Response.Write" would break the gridview sorting/paging in the updatepanel? If so, that may help pinpoint what is happening.</p> <p>Thanks all!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload