首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

.net关于 母版页 的使用 悬赏 新手

2012-04-27 
.net关于 母版页 的使用 悬赏 新手 求助!下面的是Site.Master文件的内容 就是一个菜单 没其他东西HTML cod

.net关于 母版页 的使用 悬赏 新手 求助!

下面的是Site.Master文件的内容 就是一个菜单 没其他东西

HTML code
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="CTWebPlatform.SiteMaster" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head runat="server">  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>    <title></title>    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />    <asp:ContentPlaceHolder ID="HeadContent" runat="server">    </asp:ContentPlaceHolder>  </head><body>    <form runat="server">    <div class="page">        <div class="header">            <div class="title">                <h1>                    &nbsp;数据管理平台&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                </h1>            </div>            <div class="loginDisplay">                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>                <br />                <br />            </div>            <div class="clear hideSkiplink">                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" Orientation ="Horizontal"                    IncludeStyleBlock="false"                     onmenuitemclick="NavigationMenu_MenuItemClick" ViewStateMode="Enabled"                     ClientIDMode="AutoID" EnableTheming="False" EnableViewState="False"                     RenderingMode="List" >                </asp:Menu>            </div>        </div>        <div class="main">            <asp:ContentPlaceHolder ID="MainContent" runat="server"/>        </div>        <div class="clear">        </div>    </div>    <div class="footer">            </div>    </form></body></html>


后台代码Site.Master.cs 的文件
C# code
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using CTWebPlatform.localhost;using System.Data.SqlClient;using System.Data;using System.Configuration;using System.Web.UI.HtmlControls;using System.Collections;namespace CTWebPlatform{    public partial class SiteMaster : System.Web.UI.MasterPage    {          protected void Page_Load(object sender, EventArgs e)        {            NavigationMenu.Orientation = Orientation.Horizontal;            if (((CTUser)Session["Login"]) == null)            {                 //Response.Redirect("~/SysManager/Login.aspx");              //  LinkButton1.Text = "登陆";                Label1.Text = "";            }            else            {                CreateMenu();             //   LinkButton1.Text = "退出";                string strUser = "操作员“" + ((CTUser)Session["Login"]).strUserName + "”已登陆";                Label1.Text = strUser;            }        }        protected void NavigationMenu_MenuItemClick(object sender, MenuEventArgs e)        {        }        protected void CreateMenu()        {            if ((CTUser)Session["Login"] != null)            {                CTWebPlatform.localhost.CTWebInterface mWebInt = new CTWebInterface();                IList MenuList = mWebInt.GetMenulistByUser((CTUser)Session["Login"]);                int nPItem = MenuList.Count;                for (int nIndex = 0; nIndex < nPItem; nIndex++)                {                    if (((CTSysMenuFun)(MenuList[nIndex])).subMenuList != null )                    {                        MenuItem item = new MenuItem();                        item.Text = ((CTSysMenuFun)(MenuList[nIndex])).strDisplayName;                        if ( ((CTSysMenuFun)(MenuList[nIndex])).subMenuList != null )                        {                            int nSubCount = ((CTSysMenuFun)(MenuList[nIndex])).subMenuList.Count();                            for (int nSubIndex = 0; nSubIndex < nSubCount; nSubIndex++)                            {                                MenuItem itemsub = new MenuItem();                                itemsub.Text = ((CTSysMenuFun)(MenuList[nIndex])).subMenuList[nSubIndex].strDisplayName;                                itemsub.NavigateUrl = ((CTSysMenuFun)(MenuList[nIndex])).subMenuList[nSubIndex].strMenuURL;                                item.ChildItems.Add(itemsub);                            }                        }                        NavigationMenu.Items.Add(item);                    }else                     if (((CTSysMenuFun)(MenuList[nIndex])).strDisplayName.Trim() == "首        页" || ((CTSysMenuFun)(MenuList[nIndex])).strDisplayName.Trim() == "帮        助" )                    {                        MenuItem item = new MenuItem();                        item.Text = ((CTSysMenuFun)(MenuList[nIndex])).strDisplayName;                        item.NavigateUrl = ((CTSysMenuFun)(MenuList[nIndex])).strMenuURL;                        NavigationMenu.Items.Add(item);                    }                }                if ( nPItem == 0)                {                    //Response.Redirect("~/SysManager/HelpForm.aspx");                }            }        }        protected void LinkButton1_Click1(object sender, EventArgs e)        {               //if (LinkButton1.Text == "登陆")            //{            //    Response.Redirect("~/SysManager/Login.aspx");            //}            //if (LinkButton1.Text == "退出")            //{            //    Response.Redirect("~/SysManager/Login.aspx");            //}        }    }} 



问题是这样的: 功能就是一个导航菜单,但加载数据量较大的页面 菜单的内容也就是加载的时候时晃动闪动,HTML整体布局被破坏时间大概是0.2-1秒,非常影响用户体验。我希望能够得到解决

后台文件中没有使用任何类库,因为我的数据源就是一个webserver发布的 在webserver中代码都是封装好的模块传输过来的数据直接使用 即可!
我希望能得到一个办法解决 最好还是用母版页 提供出代码思路可用者 悬赏奖励!

[解决办法]
不知道你说的什么意思,但是我想不明白这个东西你为什么不用用户控件?
[解决办法]
0.1秒。。。。。
这个貌似都会吧,数据量大点的页面都会的,不同的浏览器也会有区别

热点排行