当我执行"file"->“新建网站”并选择 C# ASP.NET 项目时 - 它会创建一个包含 About.aspx、Default.aspx 等的基本项目。这构建良好。但是,当我获得网站-> 开始选项并选择目标框架作为 .NET 2.0 时,该项目不再编译。
这些是我得到的错误
WebSite2\Account\Register.aspx(8): Build (page): Type 'System.Web.UI.WebControls.CreateUserWizard' does not have a public property named 'LayoutTemplate'.
WebSite2\Account\Register.aspx(9): Build (page): Type 'System.Web.UI.WebControls.CreateUserWizard' does not have a public property named 'PlaceHolder'.
WebSite2\Account\Register.aspx(10): Build (page): Type 'System.Web.UI.WebControls.CreateUserWizard' does not have a public property named 'PlaceHolder'.
WebSite2\Account\Register.aspx(9): Build (page): Content ('</asp:PlaceHolder> </asp:PlaceHolder> </LayoutTemplate>') does not match any properties within a 'System.Web.UI.WebControls.CreateUserWizard', make sure it is well-formed.
WebSite2\Site.master.cs(3,14): error CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)
有没有一种方法可以创建与 .NET 2.0 一起使用的默认非空项目?
最佳答案
按照以下步骤:-
或
你可以评论
using System.Linq; (from all .cs pages)
和
(来自 Register.aspx 页面)
<LayoutTemplate>
<asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"></asp:PlaceHolder>
<asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
</LayoutTemplate>
然后尝试构建。
关于c# - Visual Web Developer 2010 Express - 创建面向 .NET 2.0 的 ASP.NET 网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18079539/