如何利用ASP.NET AJAX 1.0对MultiView 里的内容进行AJAX化的显示(请进来看我的代码)
我用了一个<asp:menu>来控制 MultiView1.ActiveViewIndex ,代码在后台代码里。<form id ="form1" runat="server">
<div >
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Menu ID="Menu1" OnMenuItemClick="Menu1_MenuItemClick" Orientation="Horizontal" runat="server" >
<Items>
<asp:MenuItem Text="最近" Value="View1" ></asp:MenuItem>
<asp:MenuItem Text="最热" Value="View12"></asp:MenuItem>
</Items>
</asp:Menu>
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
<................................>
</asp:View>
<asp:View ID="View2" runat =server>
<.........................>
</asp:View>
</asp:MultiView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Menu1" EventName="MenuItemClick" />
</Triggers>
</asp:UpdatePanel>
</form>
编译运行页面,发现点MENU后,页面还是重新刷新。。不知何故。
请高手解答 --------------------编程问答-------------------- 自己顶一下 --------------------编程问答-------------------- 在线等,大伙都吃完饭了么 --------------------编程问答-------------------- ASP.NET AJAX MultiView 无刷新应用:
aspx:
<table>
<tr>
<td>
<asp:LinkButton id="LinkButton1" onclick="LinkButton1_Click" runat="server" CausesValidation="False">test1</asp:LinkButton>
</td>
<td>
<asp:LinkButton id="LinkButton2" onclick="LinkButton2_Click" runat="server" CausesValidation="False">test2</asp:LinkButton>
</td>
<tr>
</table>
....
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<DIV style="WIDTH: 400px; HEIGHT: 500px; TEXT-ALIGN: center">
<asp:MultiView id="MultiView1" runat="server">
<asp:View id="View1" runat="server">1</asp:View>
<asp:View id="View2" runat="server">2</asp:View>
</asp:View>
</asp:MultiView>
</DIV>
</ContentTemplate>
<Triggers ><asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="click"/></Triggers>
<Triggers ><asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="click"/></Triggers>
</asp:UpdatePanel>
cs:
protected void LinkButton1_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 1;
}
--------------------编程问答-------------------- 没有用过 这个控件 帮顶
补充:.NET技术 , ASP.NET