这两段代码上面一段是我的,既不执行导航按钮操作跳到另一个界面,也没有任何错误提示,下面一段代码是MSDN上摘的,没有问题,可以通过.我看这两段代码没有什么区别啊,真搞不明白是怎么回事.
<div>
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
<asp:Button ID="Button1" runat="server" Text="to view2" CommandArgument="View2" CommandName="SwithViewbyID" />view1</asp:View>
<asp:View ID="View2" runat="server">
<asp:Button ID="Button2" runat="server" Text="to view3" CommandArgument="View3" CommandName="SwithViewbyID" />view2</asp:View>
<asp:View ID="View3" runat="server">
<asp:Button ID="Button3" runat="server" Text="to view1" CommandArgument="View1" CommandName="SwithViewbyID" />view3</asp:View>
</asp:MultiView>
<%--<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
View 1<br />
<br />
<asp:Button ID="Button1" runat="server"
CommandArgument="View2"
CommandName="SwitchViewByID"
Text="Go to View2" />
</asp:View>
<asp:View ID="View2" runat="server">
View 2<br />
<br />
<asp:Button ID="Button2" runat="server"
CommandArgument="View3"
CommandName="SwitchViewByID"
Text="Go to View 3" />
</asp:View>
<asp:View ID="View3" runat="server">
View 3<br />
<br />
<asp:Button ID="Button3" runat="server"
CommandArgument="View1"
CommandName="SwitchViewByID"
Text="Go to View 1" />
</asp:View>
</asp:MultiView>--%></div>
这个写错了:CommandName="SwithViewbyID"
后边的单词有问题 你的SwithViewbyID应该写成SwitchViewByID
我试了下,这个还区分大小写.要注意了
哈哈,分拿来!!!
呵呵