ASPX页面没有渲染任何东西

时间:2011-06-23 06:38:04

标签: c# asp.net html iis

此页面根本不呈现;它只是空白。我无法弄清楚。我找不到任何HTML错误。

<%@Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="EmailListManagement.aspx.cs" Inherits="Anzalone.Symba.Admin.EmailListManagement" MasterPageFile="~/Symba/MasterPages/Admin.Master" %>

<asp:Content ContentPlaceHolderID="cphMain" runat="server">
 <div style="margin-left: auto; margin-right: auto; width: 700px;">
    <h1>Email List Management</h1>
    <div>
        Select Email List: 
    <asp:DropDownList ID="ddlSelectEmailList" runat="server">
    </asp:DropDownList>
    <br />
    <asp:Button ID="btnComposeEmailView" runat="server" Text="Compose Email" 
        onclick="btnComposeEmailView_Click" /> <asp:Button ID="btnManageListView" 
        runat="server" Text="Manage List" onclick="btnManageListView_Click" />
</div>
<div>
    <asp:MultiView ID="mvEmailListManagement" runat="server" ActiveViewIndex="0">
        <asp:View ID="viewEmpty" runat="server">             
        </asp:View>
        <asp:View ID="viewComposeEmail" runat="server">
        <div style="margin-left: auto; margin-right: auto; width: 700px;">
            <div style="padding-left: 250px; font-size: large; font-weight: bold;">Compose Email</div>
            Subject:&nbsp;<asp:TextBox ID="txtSubject" runat="server" Width="625px"></asp:TextBox>
            <br />
            <asp:TextBox ID="txtEmailMessage" runat="server" TextMode="MultiLine" Rows="20" Width="600"></asp:TextBox>
            <br />
            <div style="margin-left: 250px;">
                <asp:Label CssClass="NotificationMessage" ID="lblEmailMessage" runat="server" Visible="false"></asp:Label>
                <br />
                <asp:Button ID="btnSendEmail" runat="server" Text="Send" 
                    onclick="btnSendEmail_Click" /> <asp:Button ID="btnCancelEmail" 
                    runat="server" Text="Cancel" onclick="btnCancelEmail_Click" />
            </div>
        </div>
        </asp:View>
        <asp:View ID="viewManageList" runat="server">
        <div class="WidgetEditor">
               <div class="row">
                <span class="label">
                  Mailing List Name:
                </span>
                <span class="formw">
                 <asp:TextBox ID="txtMailingListName" runat="server"></asp:TextBox>
                </span>
               </div>
               <div class="row">
                <span class="label">
                  Smtp Server:
                </span>
                <span class="formw">
                  <asp:TextBox ID="txtSmtpServer" runat="server"></asp:TextBox>
                </span>
               </div>
               <div class="row">
                <span class="label">
                    Port:
                </span>
                <span class="formw">
                    <asp:TextBox ID="txtPort" runat="server"></asp:TextBox>
                </span>
               </div>
               <div class="row">
                <span class="label">
                   User Name:
                </span>
                <span class="formw">
                   <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
                </span>
               </div>
               <div class="row">
                <span class="label">
                   Password:
                </span>
                <span class="formw">
                   <asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>
                </span>
               </div>
               <div class="row">
                <span class="label">
                   Email From:
                </span>
                <span class="formw">
                   <asp:TextBox ID="txtEmailFrom" runat="server"></asp:TextBox>
                </span>
               </div>     
              <div class="row" style="text-align: center;">
                <asp:Label CssClass="NotificationMessage" ID="lblMailingListUpdate" runat="server" Visible="false"></asp:Label>
              </div>
              <div class="row">
                <span class="label"><asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSaveMailingListProperties_Click" /> </span>  
                <span class="formw"><asp:Button ID="btnCancel" runat="server" Text="Cancel" onclick="btnCancelManageList_Click"/></span>
              </div>  
        </div>
        <div>
            <asp:GridView ID="gvRecipients" runat="server" AllowPaging="true" AllowSorting="true" AutoGenerateColumns="false"
                OnRowCommand="gvRecipients_OnRowCommand" DataKeyNames="ID">
                <Columns>                      
                    <asp:BoundField DataField="EmailAddress" HeaderText="Email Address" SortExpression="EmailAddress" />
                    <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="UserLastName" />
                    <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="UserFirstName" />                                      
                    <asp:CommandField InsertImageUrl="~/Symba/Images/icoAdd.gif" ShowInsertButton="true"
                        DeleteImageUrl="~/Symba/Images/icoDelete.png" ShowDeleteButton="true" />                     
                </Columns>
             </asp:GridView>
         </div>
        </asp:View>
    </asp:MultiView>
</div>
</div>
</asp:Content>

有什么想法吗?

查看来源渲染:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>

这是主页:

  <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Admin.master.cs" Inherits="Anzalone.Symba.MasterPages.Admin" %>

<!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>Admin</title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>

<link href="../Styles/CSS/Symba.css" rel="stylesheet" type="text/css" />    

<script type="text/javascript" src="../../tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="../Scripts/SymbaScripts.js"></script>

<script type="text/javascript">
    tinyMCE.init({
        // General options
        mode: "textareas",
        theme: "advanced",
        plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

        // Theme options
        theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "bottom",
        theme_advanced_resizing: true,
        relative_urls: false,
        editor_deselector: "mceNoEditor",


        // Example content CSS (should be your site CSS)
        // using false to ensure that the default browser settings are used for best Accessibility
        // ACCESSIBILITY SETTINGS           
        // Use browser preferred colors for dialogs.
        browser_preferred_colors: true,
        detect_highcontrast: true,

        // Drop lists for link/image/media/template dialogs
        template_external_list_url: "lists/template_list.js",
        external_link_list_url: "lists/link_list.js",
        external_image_list_url: "lists/image_list.js",
        media_external_list_url: "lists/media_list.js",

        // Style formats
        style_formats: [
        { title: 'Bold text', inline: 'b' },
        { title: 'Red text', inline: 'span', styles: { color: '#ff0000'} },
        { title: 'Red header', block: 'h1', styles: { color: '#ff0000'} },
        { title: 'Example 1', inline: 'span', classes: 'example1' },
        { title: 'Example 2', inline: 'span', classes: 'example2' },
        { title: 'Table styles' },
        { title: 'Table row 1', selector: 'tr', classes: 'tablerow1' }
    ],

        // Replace values for the template plugin
        template_replace_values: {
            username: "Some User",
            staffid: "991234"
        },
        valid_elements: "*[*]",
        extended_valid_elements: "*[*]"
    });
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
    <asp:ContentPlaceHolder ID="cphMain" runat="server">

    </asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>

它也出现在Visual Studio设计视图中。

3 个答案:

答案 0 :(得分:1)

我怀疑它与你在那里的HTML有什么关系。要进行诊断,请创建一个仅包含熊必需品的全新页面。例如,留在母版页中,但删除Inherits和所有其他guff。请尝试以下方法;

<%@Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="MyNewPage.aspx.cs" MasterPageFile="~/Symba/MasterPages/Admin.Master" %>

<asp:Content ID="Content4" ContentPlaceHolderID="head" runat="server">
<%-- Something in the head  --%>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphMain" runat="server">
bah
</asp:Content>

作为额外的帮助,在页面和母版页的代码隐藏中放置断点以查看它是否正在加载。

一旦有效,请重新添加上面列出的内容,以确定导致问题的原因。它可能是页面代码隐藏的内容。

答案 1 :(得分:0)

仔细检查指向母版页文件的链接:


MasterPageFile="~/Symba/MasterPages/Admin.Master"

然后是Content元素的名称:cphMain

答案 2 :(得分:0)

您是否选择此页面作为启动页面。否则,请检查母版页是ContentPlaceHolderID="cphMain"匹配。