2014-01-28 48 views
1

我在我的asp.net網站的母版頁上有下面的代碼,並在運行時,它使它進入表和mt菜單沒有看到任何想法,爲什麼會發生這種情況。asp.net改變主站點佈局運行時間

我用螢火蟲來檢查代碼,我能看到,當它運行

<form runat="server"> 
    <asp:ScriptManager ID="ScriptManager1" runat="server"> 
    </asp:ScriptManager> 
    <asp:Panel ID="Panel1" runat="server" CssClass="roundPanel"> 
    <div class="page"> 
     <div class="header"> 
      <div class="title"> 
       <h1> 
        <asp:Image ID="Image1" runat="server" ImageUrl="~/images/cisi.png" 
         ImageAlign="AbsMiddle" />&nbsp;&nbsp;Professional Refresher Manager 
       </h1> 
      </div> 
      <div class="loginDisplay"> 

       <asp:Label ID="lblBreadCrumb" runat="server" Text=""></asp:Label> 
          </div> 
      <div class="clear hideSkiplink"> 
       <asp:Label ID="lblProduct" runat="server" CssClass="productHeading"></asp:Label> 
       <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" 
        EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal" 
        MaximumDynamicDisplayLevels="5" > 
        <DynamicMenuStyle CssClass="menuindex" /> 
        <Items> 
         <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/> 
         <asp:MenuItem NavigateUrl="~/Modules.aspx" Text="Modules" 
          PopOutImageUrl="~/images/ratingStarFilled.gif" Value="Modules"> 
          <asp:MenuItem NavigateUrl="~/AddModule.aspx" Text="Add New" 
           ToolTip="Add New Module" Value="Add New"></asp:MenuItem> 
         </asp:MenuItem> 
<asp:MenuItem Text="Page Templates" Value="pages"> 
         </asp:MenuItem> 
         <asp:MenuItem Text="Resources" Value="Resources"> 
          <asp:MenuItem NavigateUrl="addResource.aspx" Text="Add New" Value="Add New"> 
          </asp:MenuItem> 
         </asp:MenuItem> 
         <asp:MenuItem Text="catManager" Value="catManager" NavigateUrl="~/categoryManager.aspx"> 
         </asp:MenuItem> 
         <asp:MenuItem NavigateUrl="~/reports/reportsDefault.aspx" Text="Reports" 
          Value="Reports"> 
          <asp:MenuItem NavigateUrl="~/reports/reportsDefault.aspx" Text="Views" 
           Value="Views"></asp:MenuItem> 
          <asp:MenuItem NavigateUrl="~/reports/Candidates.aspx" Text="Candidates" 
           Value="Candidates"></asp:MenuItem> 
         </asp:MenuItem> 
        </Items> 
       </asp:Menu> 
       </div> 
         </div>&nbsp;<div class="main"> 
      <asp:ContentPlaceHolder ID="MainContent" runat="server"> 

      </asp:ContentPlaceHolder> 
     </div> 
     <div class="clear"> 
     </div> 
    </div> 
    <div class="footer"> 

    </div> 
    </asp:Panel> 
    <asp:RoundedCornersExtender runat="server" TargetControlID="Panel1"></asp:RoundedCornersExtender> 
    </form> 
+0

您是否嘗試刪除所有的CSS,看看它是否是造型問題? –

+0

我已經嘗試刪除CSS的腳本,仍然是問題 – user3086751

回答

1

吹你可以從數據庫中添加的文件的名稱,並添加代碼的代碼已經改變下面的頁面加載方法,並將在運行時添加css文件

HtmlLink subcss = new HtmlLink(); 
     subcss.Href = Name of CSS file to be loaded from database.; 
     subcss.Attributes.Add("rel", "stylesheet"); 
     subcss.Attributes.Add("type", "text/css"); 
     Page.Header.Controls.Add(subcss);