Hi,
EveryBody knows when use AJAX UpdatePanel with GridView, you change the gridview page and redirect to another web page, and then click preview button in browser, the gridview's pageindex will be the first page.
The solution is import Microsoft.Web.Preview.dll and add a "History" controler in the *.aspx page, but my problem is ... my project using Master Page and has a lot of detail pager, they will point to the same master page like MasterPageFile="~/main.Master"
Now I am trying to add History in my page, but it's seems didn't work.
How do I make it work & Where do I add this controler ?
1 <%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
2
3 <%@ Register Assembly="Microsoft.Web.Preview" Namespace="Microsoft.Web.Preview.UI.Controls"
4 TagPrefix="cc1" %>
5
6 <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
7 </asp:Content>
8 <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
9
10 <asp:ScriptManager id="SM" runat="server"></asp:ScriptManager>
11
12 <cc1:history ID="his" runat="server" OnNavigate="his_OnNavigate"></cc1:history>
13
14 <asp:UpdatePanel ID="up" runat="server">
15 <ContentTemplate>
16
17 <asp:GridView ID="gvTest" runat="server" AutoGenerateColumns="false" PageSize="10" AllowPaging="true"
18 OnRowCommand="gvTest_OnRowCommand" OnPageIndexChanging="gvTest_OnPageIndexChanging">
19 <Columns>
20 <asp:TemplateField>
21 <ItemTemplate>
22 <asp:LinkButton ID="lkn" runat="server" CommandName="row" Text='<%# Bind("COLU1") %>'></asp:LinkButton>
23 </ItemTemplate>
24 </asp:TemplateField>
25 <asp:BoundField DataField="COLU2" ShowHeader="true" ItemStyle-Width="200px" />
26 <asp:BoundField DataField="COLU3" ShowHeader="true" ItemStyle-Width="200px" />
27 </Columns>
28 </asp:GridView>
29 </ContentTemplate>
30 </asp:UpdatePanel>
31 </asp:Content>