Menu使用
即将删除代码,放在这里保存备用。
一、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
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
code001![](https://www.cnblogs.com/Images/dot.gif)
![](https://www.cnblogs.com/Images/dot.gif)
</asp:View>
<asp:View ID="View2" runat="server">
code002![](https://www.cnblogs.com/Images/dot.gif)
![](https://www.cnblogs.com/Images/dot.gif)
</asp:View>
<asp:View ID="View3" runat="server">
code003![](https://www.cnblogs.com/Images/dot.gif)
![](https://www.cnblogs.com/Images/dot.gif)
</asp:View>
</asp:MultiView>
三、事件代码
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
MultiView1.ActiveViewIndex = int.Parse(e.Item.Value);
if (e.Item.Value == "1")
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
AppGridView((string)ViewState["strResno"], (string)ViewState["strResname"], (string)ViewState["strsdate"], (string)ViewState["stredate"]);
}
if (e.Item.Value == "2")
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
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"]);
}
原文地址:https://www.cnblogs.com/cnaspnet/p/946659.html