To add a namespace globally, not page by page, just put the namespace in your web.config file.
<configuration> <system.web> <pages> <namespaces> <add namespace="Your.Namespace"/> </namespaces> </pages> </system.web> </configuration>
You may need to restart Visual Studio for IntelliSense to turn on.
You can also create a mini web.config file in a directory to import the namespace only into ASPX files in that directory and subdirectories, and not apply it globally.
Jacob Stamm Jul 09 '19 at 15:24 2019-07-09 15:24
source share