简体   繁体   English

IE中未显示Asp.net主页

[英]Asp.net masterpage is not displaying in IE

I built an internal site for my company with asp.net. 我使用asp.net为公司建立了一个内部网站。 I copied the site to the server and tested every page in both firefox and ie and everything looked fine, but i noticed that i forgot to add titles to a couple pages. 我将站点复制到服务器,并在firefox和ie中测试了每个页面,并且一切看起来都很好,但是我注意到我忘了在几个页面上添加标题。 After adding the titles and copying the updated files to the server, my master page is no longer showing when viewed in ie. 在添加标题并将更新的文件复制到服务器之后,在ie中查看时不再显示我的母版页。 All the content is still displayed, but nothing from my master page. 所有内容仍然显示,但我的主页没有任何显示。 Firefox is displaying everything normally. Firefox正常显示所有内容。 I have tried recopying all the files and restarting the app pool. 我尝试重新复制所有文件并重新启动应用程序池。 When i use ie to browse the site from the server everything works fine. 当我使用ie从服务器浏览站点时,一切正常。 Everything works fine when i preview the site locally with vwd2010. 当我使用vwd2010在本地预览站点时,一切正常。 I have tried viewing the site from 3 different machines with ie and they all are showing the same thing. 我尝试用3种不同的机器(例如ie)查看站点,它们都显示相同的内容。 Has anyone seen anything like this before? 有人看过这样的东西吗?

MasterPage 母版页

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs"     Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
    <link rel="Stylesheet" type="text/css" href="styles/Styles.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div class="page">
            <div class="header">
                <div class="title">
                    <h1>
                        register support
                    </h1>
                </div>
                <div class="clear hideSkiplink">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                    <Items>
                        <asp:MenuItem NavigateUrl="default.aspx" Text="Home"/>
                        <asp:MenuItem NavigateUrl="howto.aspx" Text="Common Problems"/>
                        <asp:MenuItem NavigateUrl="search.aspx" Text="Search"/>
                        <asp:MenuItem NavigateUrl="~/incidents.aspx" Text="Incidents" />
                    </Items>
                </asp:Menu>
                </div>
            </div>
            <div class="main">
                <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server" />
            </div>      

        </div>
        <div class="bottomlinks">
            <a href="Admin/managebroadcasts.aspx">[administrators]</a>    
        </div>  
    </div>
    </form>
</body>
</html>

Content Page: 内容页:

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <div>
        <asp:PlaceHolder ID="place1" runat="server" />
        <asp:PlaceHolder ID="place2" runat="server" />
    </div>
</asp:Content>

I am working with master pages and I would like to see what the top of your .aspx web page looks like.. for example it should look something like this 我正在使用母版页,并且我想看看.aspx网页的顶部是什么样子。例如,它应该看起来像这样

<%@ Page Title="Student Registration" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="StudentInfo.aspx.cs" Inherits="MRC_IDSWeb.Pages.StudentInfo" MaintainScrollPositionOnPostback="true" %>

Set the Page Title in the page Header Separately.. not in the html like you would in a .aspx page that does not utilize MasterPages hope this makes sense to you 在页面标题中分别设置页面标题..而不像在不使用MasterPages的.aspx页面中那样在html中设置页面标题,希望这对您有意义

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM