简体   繁体   中英

Asp.net masterpage is not displaying in IE

I built an internal site for my company with 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. After adding the titles and copying the updated files to the server, my master page is no longer showing when viewed in ie. All the content is still displayed, but nothing from my master page. Firefox is displaying everything normally. 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. Everything works fine when i preview the site locally with vwd2010. I have tried viewing the site from 3 different machines with ie and they all are showing the same thing. 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

<%@ 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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