How to add default namespaces to Web Config
I read an article here to find the solution to my problem. But I found that it is not working for me. Whenever I tries to use any f开发者_StackOverflowunction I have to add same namespace on every page. by doing using System.Web.UI
. Can I also use it for namespace that is being created along with an application. i.e. Library is an another namespace that lies in App_Code folder not as an assembly.
<pages>
<namespaces>
<add namespace="Library.ExceptionHandler"/>
<add namespace="System.Web.UI"/>
</namespaces>
</pages>
Is there any way to get them available at Code Behind Page
yes but you have to change the default C# class template for that check following article
Changing the default using directives in Visual Studio
also check this
Does C# Support Project-Wide Default Namespace Imports Like VB.NET?
精彩评论