We are rebuilding our code structures in VS 2017 from the ground up and our lead has determined that we need to commit all of our code with no compile errors or warnings in Code Analysis. As our old Code base is .net 2.0 that was last updated to .net 3.5 for some minor additions to our sites, we are incorporating tools and features in VS that are new to most of us. On an ASP.NET Web application, when adding a new aspx page to a project, it auto configures the code behind, sets the Inherits value in the markup and creates a public partial class as it always has.
public partial class webforms_divTableTest : System.Web.UI.Page
{
}
<%@ Page Language="C#" MasterPageFile="~/MenuMaster.master" AutoEventWireup="true" CodeFile="divTableTest.aspx.cs" Inherits="webforms_divTableTest" %>
As soon as I build the project it throws this warning on every page set:
RCS1110 Declare 'webforms_divTableTest' inside namespace.
This leaves me with a few questions:
Apparently I can do this:
namespace divTableTest
{
public partial class webforms_divTableTest : System.Web.UI.Page
{
}
}
and change my aspx to:
inherits="divTableTest.webforms_divTableTest"
The compiler and Code Analysis are no longer complaining. The rest of my questions still stand.
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.