.aspx代码错误"不支持元素'xxxx'."

Mik*_*ike 3 c# asp.net

我的图像按钮,链接按钮,文本框和标签都出现了一堆错误.这些错误在我的.aspx代码中.我为什么这么多?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmSearchPersonnel.aspx.cs" Inherits="frmSearchPersonnel" %> 

<!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 id="Head1" runat="server"> 
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 

    <div align="center"> 


    </div> 

    </div> 
    <asp:Label ID="Label1" runat="server" Text="Search for employee by last name"></asp:Label> 
    <asp:TextBox ID="txtSearchName" runat="server"></asp:TextBox> 
    <p> 
        <asp:Button ID="btnSearch" runat="server" PostBackUrl="~/frmViewPersonnel.aspx"  
            Text="Search" onclick="btnSearch_Click" /> 
    </p> 
    </form> 
</body> 
</html>.
Run Code Online (Sandbox Code Playgroud)

错误位于上面的Label,TextBox和Button下面.错误状态:

验证():不支持元素'xxxx'.

Ed *_*d B 6

我和我的Resharper看到的唯一问题是结束html标记之后的时期.

</html>.
Run Code Online (Sandbox Code Playgroud)

你得到的错误是什么?

编辑:

这是一个简单的解决方案:

http://weblogs.asp.net/alaaalnajjar/archive/2010/08/31/how-to-fix-quot-validation-element-xxxx-is-not-supported-quot-visual-studio-2010.aspx

我们的想法是从路径中删除"ReflectedSchemas"文件夹:

Win XP:C:\ Documents and Settings {username}\Application Data\Microsoft\VisualStudio\10.0\ReflectedSchemas

Win Vista/7:C:\ Users\AppData\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas

注意:确保从"文件夹选项"中选择"显示隐藏文件,文件夹和驱动器",也不要忘记在删除文件夹之前关闭VS.

此解决方案适用于VS2010和VS2008,在VS2008中,您必须从文件夹9.0中删除ReflectedSchemas而不是10.0.


Jam*_*son 5

此问题之前已有报道.我发现了一篇包含要解决的步骤的文章:

  1. 关闭Visual Studio 2008(或Visual Studio 2010).
  2. 转到"控制面板" - >"外观和个性化" - >"文件夹选项" - >然后选择"视图"选项卡.现在确保选中"显示隐藏文件,文件夹和驱动器",然后单击"确定".
  3. 现在浏览到以下文件夹:计算机 - > OS(C :) - >用户 - > {用户名} - > AppData - >漫游 - > Microsoft - > VisualStudio - > 9.0文件夹.注意:在Visual Studio 2010中将是10.0文件夹.
  4. 现在删除"ReflectedSchemes"文件夹.这应修复"验证():元素"不支持"Visual Studio 2008中的ASP.NET服务器控件的错误.
  5. 重新打开Visual Studio 2008项目后,您现在应该可以正确处理ASP.NET服务器控件的智能感知.

有关详细信息,请参见此处:http:
//www.gotknowhow.com/articles/fix-validation-element-not-supported-visual-studio-2010