Element is not a known element warning in Visual Studio when using User controls

后端 未结 7 1750
深忆病人
深忆病人 2021-01-03 21:04

I have a Visual Studio 2008 project that is showing the following warning when using User Controls, and I haven’t been able to find a solution anywhere.

7条回答
  •  长情又很酷
    2021-01-03 22:07

    From the OP:

    The apparent solution to this is to make sure that the TagName is the name of control class.

    So for my example, the following displayed the warning:

    <%@ Register Src="~/path/to/Control.ascx" TagName="tagName" TagPrefix="tagprefix" %>
    

    But changing it to:

    <%@ Register Src="~/path/to/Control.ascx" TagName="Control" TagPrefix="tagprefix" %>
    

    fixes it.

提交回复
热议问题