Links an assembly to an ASP.NET application file (such as a Web page, a user control, a master page, or a Global.asax file) during compilation, making all the assembly's classes and interfaces available for use.
The compiler references the assembly at compile time, allowing early binding. After compilation of the requested ASP.NET file is complete, the assembly is loaded into the application domain, allowing late binding. The @ Assembly directive can be used in .aspx pages, .ascx files, .master pages and .asax files.
Assemblies that reside in your Web application's \Bin directory are automatically linked to ASP.NET files within that application. Such assemblies do not require the @ Assembly directive. You can disable this functionality by removing the following line from the <assemblies> section of your application's Web.config file:
As an alternative to using the @ Assemblydirective, you can use the Web.config file to link assemblies across an entire application. For more information about the Web.config file and configuring your application, see ASP.NET Configuration Overview and assemblies Element for compilation (ASP.NET Settings Schema).
The following code example uses two @ Assembly directives, the first to link to MyAssembly, a user-defined assembly, and the second to MySource.vb, a Visual Basic source file.
<%@ Assembly Name="MyAssembly" %> <%@ Assembly Src="MySource.vb" %>