母版页继承标签问题

mwr*_*ght 2 asp.net master-pages

通过此处列出的Microsoft身份验证教程,您可以创建母版页.在Visual Studio生成后,文件中的第一个列表如下所示:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="FormsAuthentication.Site" %>
Run Code Online (Sandbox Code Playgroud)

该项目称为FormAuthentication,主页面名为Site.Master.运行项目时,我收到错误:

Compiler Error Message: CS0426: The type name 'Site' does not exist in the type 'System.Web.Security.FormsAuthentication'
Run Code Online (Sandbox Code Playgroud)

并且在自动生成的文件中引用的行如下所示

Line 133:        [TemplateContainer(typeof(FormsAuthentication.Site))]
Run Code Online (Sandbox Code Playgroud)

删除该初始标记的"Inherits ='FormsAuthentication.Site'"部分可以解决问题,但我正在尝试了解这里发生的事情.这里到底发生了什么?

And*_*zub 6

项目名称(可能是名称空间)与ASP.NET表单验证类名称冲突:System.Web.Security.FormsAuthentication.我认为你缺少命名空间名称或参考.