一、Menu菜单:
<asp:Menu ID="Menu1" runat="server" StaticSubMenuIndent="10px" Orientation="Horizontal" OnMenuItemClick="Menu1_MenuItemClick" Font-Bold="True">
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" BorderColor="#CCCCCC"
BorderStyle="Solid" BorderWidth="1px" />
<StaticSelectedStyle BackColor="#CCCCCC" ForeColor="White" BorderStyle="Inset" />
<StaticHoverStyle BackColor="CornflowerBlue" ForeColor="White" BorderStyle="Inset" />
<Items>
<asp:MenuItem Text="待签申请单" Selected="True" Value="0"></asp:MenuItem>
<asp:MenuItem Text="完成签核单" Value="1"></asp:MenuItem>
<asp:MenuItem Text="所有签核单" Value="2"></asp:MenuItem>
</Items>
</asp:Menu>
二、MultiView<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" BorderColor="#CCCCCC"
BorderStyle="Solid" BorderWidth="1px" />
<StaticSelectedStyle BackColor="#CCCCCC" ForeColor="White" BorderStyle="Inset" />
<StaticHoverStyle BackColor="CornflowerBlue" ForeColor="White" BorderStyle="Inset" />
<Items>
<asp:MenuItem Text="待签申请单" Selected="True" Value="0"></asp:MenuItem>
<asp:MenuItem Text="完成签核单" Value="1"></asp:MenuItem>
<asp:MenuItem Text="所有签核单" Value="2"></asp:MenuItem>
</Items>
</asp:Menu>
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
code001
</asp:View>
<asp:View ID="View2" runat="server">
code002
</asp:View>
<asp:View ID="View3" runat="server">
code003
</asp:View>
</asp:MultiView>
三、事件代码<asp:View ID="View1" runat="server">
code001
</asp:View>
<asp:View ID="View2" runat="server">
code002
</asp:View>
<asp:View ID="View3" runat="server">
code003
</asp:View>
</asp:MultiView>
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MultiView1.ActiveViewIndex = int.Parse(e.Item.Value);
if (e.Item.Value == "1")
{
AppGridView((string)ViewState["strResno"], (string)ViewState["strResname"], (string)ViewState["strsdate"], (string)ViewState["stredate"]);
}
if (e.Item.Value == "2")
{
GridViewBind((string)ViewState["strResno"], (string)ViewState["strResname"], (string)ViewState["strsdate"], (string)ViewState["stredate"]);
}
ListGridView((string)ViewState["strResno"], (string)ViewState["strResname"], (string)ViewState["strsdate"], (string)ViewState["stredate"]);
}
{
MultiView1.ActiveViewIndex = int.Parse(e.Item.Value);
if (e.Item.Value == "1")
{
AppGridView((string)ViewState["strResno"], (string)ViewState["strResname"], (string)ViewState["strsdate"], (string)ViewState["stredate"]);
}
if (e.Item.Value == "2")
{
GridViewBind((string)ViewState["strResno"], (string)ViewState["strResname"], (string)ViewState["strsdate"], (string)ViewState["stredate"]);
}
ListGridView((string)ViewState["strResno"], (string)ViewState["strResname"], (string)ViewState["strsdate"], (string)ViewState["stredate"]);
}