首页 .NET/Web MultiView的用法

MultiView的用法

作者:胡同里的砖头 围观群众:1942 更新于:2013-12-19

<asp:Menu ID="Menu1" runat="server" onmenuitemclick="Menu1_MenuItemClick" Orientation="Horizontal" Width="700px" ForeColor="Green" Font-Bold="true">
<Items>
<asp:MenuItem Text="形态特征" Value="0" />
<asp:MenuItem Text="药材鉴别" Value="1" />
<asp:MenuItem Text="成份药理" Value="2" />
<asp:MenuItem Text="功效主治" Value="3" />
<asp:MenuItem Text="验方/妙用" Value="4" />
<asp:MenuItem Text="用药禁忌" Value="5" />
</Items>
<LevelMenuItemStyles>
<asp:MenuItemStyle BorderColor="Gray" BorderWidth="1px" Height="30px" HorizontalPadding="30px"  />
</LevelMenuItemStyles>
<LevelSelectedStyles>
<asp:MenuItemStyle BackColor="SlateGray" ForeColor="White" />
</LevelSelectedStyles>
</asp:Menu>
<br /><br />
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
    <asp:View ID="View1" runat="server">
        <div style="width:740px; margin:10px 10px; text-align:left; line-height:22px">
            药材鉴别
        </div>
    </asp:View>
    <asp:View ID="View2" runat="server">
        <div style="width:740px; margin:10px 10px; text-align:left; line-height:22px">
            药材鉴别
        </div>
    </asp:View>
    <asp:View ID="View3" runat="server">
        <div style="width:740px; margin:10px 10px; text-align:left; line-height:22px">
            药材鉴别
        </div>
    </asp:View>
    <asp:View ID="View4" runat="server">
        <div style="width:740px; margin:10px 10px; text-align:left; line-height:22px">
            药材鉴别
        </div>
    </asp:View>
    <asp:View ID="View5" runat="server">
        <div style="width:740px; margin:10px 10px; text-align:left; line-height:22px">
            药材鉴别
        </div>
    </asp:View>
    <asp:View ID="View6" runat="server">
        <div style="width:740px; margin:10px 10px; text-align:left; line-height:22px">
            药材鉴别
        </div>
    </asp:View>
</asp:MultiView>

添加Menu的Click事件:

protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
    {
        MultiView1.ActiveViewIndex = Int32.Parse(e.Item.Value);
    }
效果:


  • 本文标题: MultiView的用法
  • 文章分类:【.NET/Web】
  • 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.
留言评论
站点声明:
1、本站【胡同里的砖头】个人博客,借鉴网上一些博客模板,取其各优点模块自行拼装开发,本博客开发纯属个人爱好。
2、所有笔记提供给广大用户交流使用,可转载,可复制,纯个人开发所遇问题锦集记录使用
Copyright © huzlblog.com All Rights Reserved. 备案号:苏ICP备2021056683号-8