日期:2014-05-17  浏览次数:20405 次

AJAX刷新页面怎么保存结果?
最近刚开始玩JQuery还有ASP.net AJAX,尝试做一个条件查询的功能。
特效和局部刷新完成了,基本结构就是一个updatePanel里包含一个Listbox,然后点击里面的选项作为查询条件,但是问题出来了,发现ViewState不能使用,问下大家,碰到这种问题是怎么处理的?怎么获取值然后进行查询?

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <asp:ListBox ID="RootLB" runat="server" AutoPostBack="True" Height="200px" OnSelectedIndexChanged="RootLB_SelectedIndexChanged"
                                                Width="195px"></asp:ListBox>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>

<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                                        <ContentTemplate>
                                            <asp:ListBox ID="ChildLB" runat="server" AutoPostBack="True" Height="200px" OnSelectedIndexChanged="ChildLB_SelectedIndexChanged"
                                                Width="195px"></asp:ListBox>
                                        </ContentTemplate>
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="RootLB" EventName="SelectedIndexChanged" />
       &