2011-11-17 22 views
3

我收到了一堆这些错误为我的图像按钮,链接按钮,文本框和标签。这些错误在我的.aspx代码中。为什么我得到这么多?.aspx代码错误“元素'xxxx'不受支持。”

<%@ 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>. 

的错误是在标签,文本框&按钮的上方为蓝色。错误状态:

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

+0

istead你能不能给我们的错误文本和行号吗? – Rup

+0

@Rup:错误位于标签,文本框和上方的蓝色下方。错误状态验证():元素'xxxx'不受支持。 – Mike

+0

您是否尝试关闭Visual Studio中的文件并重新打开它,查看错误是否消失?似乎回想起有时在新创建的文件上发生这种情况。 –

回答

6

我唯一的问题我&我的Resharper看到的是结束html标记后的时期。

</html>. 

你正在得到什么错误?

编辑:

这里有一个简单的解决有人有:

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 {用户名} \ Application 数据\微软\ VisualStudio的\ 10.0 \ ReflectedSchemas

赢Vista/7的:C:\用户\应用程序数据\漫游 \微软\ VisualStudio的\ 10.0 \ ReflectedSchemas

注:确保“显示隐藏文件,文件夹和驱动器“是从文件夹选项中选择的 ,也不要忘记在删除该文件夹之前先关闭VS 。

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

+0

这不应该导致编译错误,尽管 - 就ASP.NET的有关这只是额外的文本发送到HTML页面。但是,我没有看到任何明显的。 – Rup

+0

@Ed B:错误状态验证():元素'xxxx'不受支持。 – Mike

+0

试试这个修复我上面添加..看起来非常简单 –

5

此问题已报告过。我发现有步骤的文章来解决:

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

在这里看到更多的细节:

+0

我正在通过思杰工作。我不认为我有权访问该文件夹。 – Mike

+0

你应该这样做 - 它在你的个人资料里面。如果您看不到目录,请尝试输入路径,因为那里会隐藏文件夹。如果你在Vista系统之前查找'\ Documents and Settings \ Mike \ Application Data \ Microsoft \ VisualStudio \ 10.0'等等 – Rup

+0

嗨thanx适用于windows 7 + vs 2010 .. –

0

对于那些 “ReflectedSchemas” 的删除文件夹没有工作 - 做以下

  • 关闭Visual Studio的
  • 再试一次删除(Windows 7路径):
 
    C:\Users\DefaultAppPool\AppData\Roaming\Microsoft\VisualStudio\ReflectedSchemas 
    C:\Users\Classic .NET AppPool\AppData\Roaming\Microsoft\VisualStudio\ReflectedSchemas 
    C:\Users\Classic .NET AppPool\AppData\Local\Microsoft\VisualStudio\ReflectedSchemas 
    C:\Users\[your_nt_name]\AppData\Local\Microsoft\VisualStudio\ReflectedSchemas 
    C:\Users\[your_nt_name]\AppData\Roaming\Microsoft\VisualStudio\ReflectedSchemas 
  • 对我来说,上面没有工作,所以我干脆复制整个文件夹

用户[your_nt_name] \应用程序数据\漫游\微软\ VisualStudio的

从另一台机器在那里,这些问题都没有发生。在此之后,所有ASP.net IntelliSence问题都消失了。

我保留VistualStudio文件夹的压缩备份以防再次发生这种情况。

1

在帮助别人,从谷歌搜索像我这样的希望:

的Visual Studio 2013 - 我也同样由他人删除“ReflectedSchemes”文件夹无济于事的建议。

最后,我删除<html xmlns="http://www.w3.org/1999/xhtml"> - 然后更换它,问题突然消失。想想看,似乎我也是这样做过的。

FWIW ....

0

将此内容添加到您的网页中。

<!DOCTYPE html> 

    <html lang="en"> 

<!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"> 
相关问题