我用了ajax中的控件updaterpanel,但是还是不刷新,请各位帮帮忙。
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList Style="z-index: 0" ID="dropCate" runat="server" OnSelectedIndexChanged="dropCate_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList Style="z-index: 0" ID="dropCate1" runat="server">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="dropCate" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList Style="z-index: 0" ID="dropCate" runat="server" OnSelectedIndexChanged="dropCate_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList Style="z-index: 0" ID="dropCate1" runat="server">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="dropCate" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
this.UpdatePanel1.Update();
先安装ASPAJAXExtSetup.msi
安装好了之后:配置web.config
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers> 试一下这个