为什么要放在内容标签中,当服务器控件下划线? [英] Why server controls are underlined when placed inside Content tags?

查看:116
本文介绍了为什么要放在内容标签中,当服务器控件下划线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含事业部 A Web内容形式和像的DropDownList 各种服务器控件。当我运行应用程序,它运行良好,无任何错误,但是当我查看HTML源代码,服务器控件红色下划线。超过使鼠标,说,的DropDownList ,会显示一个提示警告:

 的DropDownList不是一个已知的元素。如果在一个网站编译错误可能出现这种情况。

编辑

 <%@页面语言=C#的MasterPageFile =〜/ MasterPage.masterAutoEventWireup =真codeFILE =contentReportSchemesMenu.aspx.cs继承= contentReportMenu标题=报告菜单%GT;< ASP:内容ID =ContentReportMenuContentPlaceHolderID =ContentPlaceHolder1=服务器>
    < D​​IV ID =divMenu级=divMenu=服务器>
        <表ID =tblMenuLayout级=选项=服务器>
        &所述; TR>
            < TD合并单元格=2级=评出的>计划报告菜单< / TD>
            < TD>< / TD>
        < / TR>
            &所述; TR>
                < TD类=左>报告类型< / TD>
                < TD类=右>
                        &安培; NBSP;< ASP:DropDownList的ID =ddlReportType=服务器的AutoPostBack =真OnSelectedIndexChanged =ddlReportType_SelectedIndexChanged>< / ASP:DropDownList的>
                < / TD>
            < / TR>
            &所述; TR>
                < TD类=左>选择地区< / TD>
                < TD类=右>
                        &安培; NBSP;< ASP:DropDownList的ID =ddlDistrict=服务器的AutoPostBack =真OnSelectedIndexChanged =ddlDistrict_SelectedIndexChanged启用=FALSE>< / ASP:DropDownList的>
                < / TD>
            < / TR>
            &所述; TR>
                < TD类=左>选择Block< / TD>
                < TD类=右>
                    &安培; NBSP;< ASP:DropDownList的ID =ddlBlock=服务器的AutoPostBack =真启用=FALSEOnSelectedIndexChanged =ddlBlock_SelectedIndexChanged>< / ASP:DropDownList的>
                < / TD>
            < / TR>
            &所述; TR>
                < TD合并单元格=2的风格=文本对齐:中心>
                    < ASP:按钮的ID =btnSubmit按钮=服务器文本=提交的OnClick =btnSubmit_Click启用=FALSE/>
                    &安培; NBSP;< / TD>
                < TD>< / TD>
            < / TR>
        < /表>
    < / DIV>
< / ASP:内容>


解决方案

一个快速谷歌搜索很快就找到了解决方案:从C删除文件:\\ Documents和Settings [用户名] \\应用数据\\微软\\ VisualStudio的\\ 9.0 \\ ReflectedSchemas文件夹(或... \\ VisualStudio的\\ 8.0 \\ ...如果运行Visual Studio 2005)在Windows XP中。在Windows 7是在C:\\用户{​​用户配置文件} \\应用程序数据\\漫游\\微软...等等。也请记住路径的VisualStudio的部分将取决于安装的版本是不同的。

我关闭的Visual Studio(总是一个好的想法会影响IDE的变化),删除的文件,然后重新打开该项目。这些警告都不见了。

我发现这个溶液在出处:
http://forums.asp.net/t/1205528.aspx
http://blogs.msdn.com/mikhailarkhipov/archive/2005 /04/21/410557.aspx

仅供参考,我在谷歌使用的是元素不被支持搜索词。

我不知道为什么会这样,但我知道有一些古怪域配置文件的东西在网络environmnet发生。

I have a Web Content Form containing a Div and various Server controls like DropDownList. When I run the application, it runs well without any errors, but when I view the HTML source, the Server controls are red underlined. On bringing the mouse over, say, DropDownList, a tooltip warning is displayed:

DropDownList is not a known element. This can occur if there is a compilation error in a website.

Edited

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="contentReportSchemesMenu.aspx.cs" Inherits="contentReportMenu" Title="Reports Menu" %>

<asp:Content ID="ContentReportMenu" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="divMenu" class="divMenu" runat="server">
        <table id="tblMenuLayout" class="Options" runat="server">
        <tr>
            <td colspan="2" class="Top">Scheme Reports Menu</td>
            <td></td>
        </tr>
            <tr>
                <td class="Left">Report Type</td>
                <td class="Right">
                        &nbsp;<asp:DropDownList ID="ddlReportType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlReportType_SelectedIndexChanged"></asp:DropDownList>
                </td>
            </tr>        
            <tr>
                <td class="Left">Select District</td>
                <td class="Right">
                        &nbsp;<asp:DropDownList ID="ddlDistrict" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlDistrict_SelectedIndexChanged" Enabled="False"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="Left">Select Block</td>
                <td class="Right">
                    &nbsp;<asp:DropDownList ID="ddlBlock" runat="server" AutoPostBack="true" Enabled="False" OnSelectedIndexChanged="ddlBlock_SelectedIndexChanged"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align:center">
                    <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" Enabled="False" />
                    &nbsp;</td>
                <td></td>
            </tr>
        </table>
    </div>
</asp:Content>

解决方案

A quick Google search soon found the solution: Delete the files from "C:\Documents and Settings[Username]\Application Data\Microsoft\VisualStudio\9.0\ReflectedSchemas" folder (or "…\VisualStudio\8.0\…" if running Visual Studio 2005) in Windows XP. In Windows 7 it is under "C:\Users{User Profile}\AppData\Roaming\Microsoft...etc". Remember also the "VisualStudio" part of the path will be different depending on the version installed.

I closed Visual Studio (always a good ideas for changes that will affect the IDE), deleted the files then re-opened the project. The warnings were gone.

I found references to this solution at: http://forums.asp.net/t/1205528.aspx http://blogs.msdn.com/mikhailarkhipov/archive/2005/04/21/410557.aspx

FYI, the search term I used in Google was "element is not supported".

I don't know why this happens but I do know there are some flakey domain profile things happening in the network environmnet.

这篇关于为什么要放在内容标签中,当服务器控件下划线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆