<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ViewDictTosPrefix.ascx.cs" Inherits="DotNetNuke.Modules.HRAddUser.ViewDictTosPrefix" %> <style type="text/css"> #MenuBox { height: 32px; background-color: #1885c6; } #MenuBox ul { font-size: 1.3em; list-style: none; margin: 0px; padding: 0px; } #MenuBox li { float: left; padding: 0px 0px 0px 0px; margin: 0px; cursor: hand; background-color: #1885c6; color: #f0f7fd; font-family: SimSun; font-size: 14pt; font-weight: bold; text-align: center; vertical-align: central; } #MenuBox li a { display: block; padding: 3px 6px 3px 6px; text-decoration: none; border: 1px solid #711525; margin: 2px; } #MenuBox li a:link, #MenuBox li a:visited { background-color: #0c6498; color: #FFFFFF; } #MenuBox li a:hover { background-color: #0c6498; color: #ffff00; } .Remark { padding-left: 20px; border-style: dashed; border-color: black; border-width: 3px; font-family: FangSong; font-size: small; font-weight: bold; } </style> <div id="MenuBox"> <ul id="tabMenu"> <li> <asp:LinkButton ID="btnOldPrefix" runat="server" Text="页面1" OnClick="btnOldPrefix_Click"></asp:LinkButton></li> <li> <asp:LinkButton ID="btnNewPrefix" runat="server" Text="页面2" OnClick="btnNewPrefix_Click"></asp:LinkButton></li> </ul> </div> <asp:Panel ID="panOldPrefix" runat="server"> <div>page1</div> </asp:Panel> <asp:Panel ID="panNewPrefix" runat="server"> <div>page2</div> </asp:Panel> <div> <asp:Label ID="lblShowPane" runat="server" Visible="false" ForeColor="Blue"></asp:Label> </div> using System; using System.Data; using System.Web.UI.WebControls; using DotNetNuke.Modules.Tos; using DotNetNuke.Modules.HRAddUser; using DotNetNuke.Security; using DotNetNuke.Services.Localization; namespace DotNetNuke.Modules.HRAddUser { public partial class ViewDictTosPrefix : DotNetNuke.Entities.Modules.PortalModuleBase, DotNetNuke.Entities.Modules.IActionable { private HRAddUserController hrc = new HRAddUserController(); private TosController cc = new TosController(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblShowPane.Text = "panOldPrefix"; } FillDG(); if (!IsPostBack) { FillUI(); } } private void FillDG() { switch (lblShowPane.Text) { case "panOldPrefix": break; case "panNewPrefix": break; default: break; } } private void FillUI() { panOldPrefix.Visible = false; panNewPrefix.Visible = false; switch (lblShowPane.Text) { case "panOldPrefix": panOldPrefix.Visible = true; break; case "panNewPrefix": panNewPrefix.Visible = true; break; default: break; } } protected void btnOldPrefix_Click(object sender, EventArgs e) { lblShowPane.Text = "panOldPrefix"; FillDG(); FillUI(); } protected void btnNewPrefix_Click(object sender, EventArgs e) { lblShowPane.Text = "panNewPrefix"; FillDG(); FillUI(); } } }