简体   繁体   English

BC30451:未声明'NewsBody'。 由于其保护级别,它可能无法访问

[英]BC30451: 'NewsBody' is not declared. It may be inaccessible due to its protection level

Try as i might i cant get past this error. 尝试,因为我可能无法克服此错误。 I'm not an ASP.Net developer but due to reasons outside my control have to develop 2-3 pages in ASP. 我不是ASP.Net开发人员,但由于无法控制的原因,必须在ASP中开发2-3页。

I'm using Dreamweaver and have the asp.net set to compile at first load. 我正在使用Dreamweaver,并将asp.net设置为在首次加载时进行编译。

.aspx File .aspx文件

<%@ Page Language="vb" AutoEventWireup="false"  Src="Scripts/CurrentNews.aspx.vb" Inherits="NewsFunctionality" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>News</title>
<link rel="stylesheet" type="text/css" href="CSS/NewsLayoutOne.css"/>
</head>
<body>
    <div class="OuterDiv" runat="server">
        <img id="NewsImage" src="Images/DefaultNews1.png" >
        <div id="NewsBody" runat="server">Original Text</div>
    </div>
</body>
</html>

.aspv.vb file .aspv.vb文件

' VB Document
public partial Class NewsFunctionality
    Inherits System.Web.UI.Page
    'On load event for the page linked to this class file
   protected sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
       NewsBody.InnerHTML = "<p>Dynamic Text Generated.</p>"
    End Sub
End Class

Check that 'NewsBody' have been declared within the designer.vb file. 检查是否在designer.vb文件中声明了“ NewsBody”

It could look something like this since you are using a div: 由于您使用的是div,因此看起来可能像这样:

    protected global::System.Web.UI.HtmlControls.HtmlGenericControl NewsBody;

暂无
暂无

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

相关问题 BC30451:未声明&#39;MailValidation&#39;。 由于其保护级别,它可能无法访问 - BC30451: 'MailValidation' is not declared. It may be inaccessible due to its protection level 未声明下拉列表。 由于其保护级别,它可能无法访问 - dropdownlist is not declared. It may be inaccessible due to its protection level 未声明“ ZoneDropDown”。 由于其保护级别,它可能无法访问 - 'ZoneDropDown' is not declared. It may be inaccessible due to its protection level 未声明控制权。 由于其保护级别,它可能无法访问 - Control is not declared. It may be inaccessible due to its protection level &#39;ViewBag&#39;未声明。 由于其保护级别,它可能无法访问 - 'ViewBag' is not declared. It may be inaccessible due to its protection level 'txtName' 未声明。 由于其保护级别,它可能无法访问 - 'txtName' is not declared. It may be inaccessible due to its protection level (VB.NET)未声明“ VB6”。 由于其保护级别,它可能无法访问 - (VB.NET) 'VB6' is not declared. It may be inaccessible due to its protection level 我收到“未声明&#39;Eval&#39;。 由于它的保护级别,它可能无法访问。 - I'm getting “'Eval' is not declared. It may be inaccessible due to its protection level” in a ascx 添加的asp控件给出错误&#39;未声明。 由于其保护级别,它可能无法访问。 - added asp control gives error 'is not declared. It may be inaccessible due to its protection level.' Asp.net成员资格配置文件的名字和姓氏(未声明。由于其保护级别,可能无法访问) - Asp.net Membership Profile FirstName and LastName (Not declared. It may be inaccessible due to its protection level )
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM