我有一个搜索页面。在列表中显示搜索结果。
当我从页码中选择另一个页面时,搜索结果消失并显示列表,就像页面刷新一样。我该怎么办?我尝试了 OnSelectedIndexChanged 和 OnSelectedIndexChanging。并没有奏效。谢谢你。
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
CellPadding="4" DataSourceID="ahsun" ForeColor="#333333" GridLines="None" Width="100%"
DataKeyNames="SICIL_NO" OnSelectedIndexChanged="LinkButton1_Click" CssClass="icerik" o >
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
CssClass="hover" Text="Seç"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Adı" SortExpression="ADI">
<ItemTemplate>
<asp:LinkButton ID="LinkButton3" runat="server" Text='<%# Bind("ADI") %>' CausesValidation="False"
CommandName="Select" CssClass="hover"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Soyadı" SortExpression="SOYADI">
<ItemTemplate>
<asp:LinkButton ID="LinkButton4" runat="server" Text='<%# Bind("SOYADI") %>' CausesValidation="False"
CommandName="Select" CssClass="hover"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Birimi" SortExpression="BIRIMI">
<ItemTemplate>
<asp:LinkButton ID="LinkButton5" runat="server" Text='<%# Bind("BIRIMI") %>' CausesValidation="False"
CommandName="Select" CssClass="hover"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Görevi" SortExpression="GOREVI">
<ItemTemplate>
<asp:LinkButton ID="LinkButton6" runat="server" Text='<%# Bind("GOREVI") %>' CausesValidation="False"
CommandName="Select" CssClass="hover"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#EFF3FB" HorizontalAlign="Left" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="ahsun" runat="server" ConnectionString="<%$ ConnectionStrings:oraLiveConnectionString %>"
ProviderName="<%$ ConnectionStrings:oraLiveConnectionString.ProviderName %>"
SelectCommand="select SICIL_NO, ADI, SOYADI, BIRIMI ,GOREVI,PERSON_ID from xxah_hr_calisanlar WHERE SICIL_NO <> '01470' "></asp:SqlDataSource>
<br />
<asp:DetailsView ID="DetailsView1" runat="server" CellPadding="4" DataKeyNames="SICIL_NO"
DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" Height="50px"
Width="100%" CaptionAlign="Left" AutoGenerateRows="False" CssClass="icerik">
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
<EditRowStyle BackColor="#2461BF" />
<RowStyle BackColor="#EFF3FB" HorizontalAlign="Left" Width="75%" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" Width="25%" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left"
Width="25%" />
<AlternatingRowStyle BackColor="White" />
<Fields>
<asp:BoundField DataField="ADI" HeaderText="Adı" SortExpression="ADI" />
<asp:BoundField DataField="SOYADI" HeaderText="Soyadı" SortExpression="SOYADI" />
<asp:BoundField DataField="BIRIMI" HeaderText="Birimi" SortExpression="BIRIMI" />
<asp:BoundField DataField="GOREVI" HeaderText="Görevi" SortExpression="GOREVI" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:oraLiveConnectionString %>" EnableCaching="True"
ProviderName="<%$ ConnectionStrings:oraLiveConnectionString.ProviderName %>"
SelectCommand="select c.* from TABLE c where c.SICIL_NO=:sicil" >
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="sicil" PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>