How to Import Namespace on ASP.net Page

佐手、 提交于 2019-12-11 04:59:09

问题


I have created a Class named SearchableGridView in my App_Code directory. I'm using

<Assembly: TagPrefix("MyApp.WebControls", "SearchGridView")> 
Namespace MyApp.WebControls

I have referenced it in web.config as:

<add namespace="MyApp.WebControls"/>

I have also included the following on my content page:

<%@ Import Namespace="MyApp.WebControls" %>

<asp:SearchGridView ID="SearchGridView1" runat="server">
</asp:SearchGridView>  

However, when I build the project, I receive the error: Warning 1 Element 'SearchGridView' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.

How do I rectify this situation?

Thanks much for your help and guidance!

来源:https://stackoverflow.com/questions/2256955/how-to-import-namespace-on-asp-net-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!