当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - ASPX page not rendering anything

问题描述:

This page isn't rendering at all; It's just blank. I can't figure it out. I can't find any html errors.

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

Any ideas?

View Source renders:

<!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>

Here is the masterpage:

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

Also it showed up in the Visual Studio design view.

网友答案:

I doubt it will have anything to do with the HTML you have there. To diagnose it, create a brand new page with just the bear essentials. For example, leave in the master page, but remove Inherits and all the other guff. Try the following;

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

As an additional help, put breakpoints in the codebehind of the page and the masterpage to see if it is getting loaded.

Once that is working, re-add your content listed above to determine what is causing the issue. It is possibly something in the codebehind of the page.

网友答案:

Double check the link to the masterpage file :


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

And then the name of the Content element : cphMain

网友答案:

Have you selected this page as the startup page. Otherwise check the master page are the ContentPlaceHolderID="cphMain" matching.

分享给朋友:
您可能感兴趣的文章:
随机阅读: