Different Directives for Dot NET
Directives are those that are responsible for any kind of change in the settings that decide the actions of an entire page. They are language specific and for .NET they function as settings of the parser and compiler. They can be used anywhere in a page, but in most of the cases it is best to use them in the beginning of the page for best results. Directives are used in both .aspx files (ASP.NET pages) and .ascx files (user control pages).
Let see some of the main kinds of Directives used:
@Page directive:
This is used to define page specific attributes used by ASP.NET page parser and compiler. It can be included only in .aspx files and it also defines the language of the page just like c# and VB.
@Control:
This works much in the same way except that it is used specifically for User Controls. Also included only in .aspx and they control the view state of the page.
@Import:
This one is used to import a namespace into a page or user space. But one directive can import any one namespace only and if there is a need to import more than one then multiple directives will have to be used.
@Implements:
It shows whether the current page or a particular user control follows the specified .NET framework interface or not.
@Register:
This one is a powerful tool which is used to create dynamically creating tags that represent your user controls. It helps to create a tag name and tag prefix to which all the user controls are associated and can be dropped onto a page by just one single simple tag.
@Assembly:
This is used to link an assembly to an application or a web page at parse time. It is contained in either global.asax file, for application-wide linking, or in a page (.aspx) or user control (.ascx) file, for linking to a specific page or user control. Each of these assembly directives can have multiple attribute or value pairs.
@OutputCache:
The OutputCache directive controls output caching for a page or user control.
@Reference:
This one allows you to know that you another page or user control has to be connected with the current page. This gives you access to the controls on the linked page and user control as a part of the Control Collection object.
blackberry cases Protect your BlackBerry with BlackBerry cases and BlackBerry screen protectors. Tru Protection manufactures and sells cases, anti-glare films and protective films and other accessories for BlackBerry products. Seo company Crest Media Inc. is an internet advertising firm that provides web development, video production and all of your internet marketing needs. Please call 626-353-4101 for more information. Hotels in newcastle Hotels in Newcastle cant compete with the tranquility of the Rosebery Jesmond Hotel. We have a wealth of charm, large rooms and period features which you wont find in other Newcastle Hotels. antivirus download free Free.antivirus.com creates a world safe for exchanging digital information by offering a comprehensive array of customizable solutions to enterprises, small and medium businesses and individuals. Security News Simply Security News and opinions provides daily security and threat news updates from multiple information sources.
Antivirus Trend Micro is a global leader in network antivirus and internet content security software and services with focus on outbreak prevention and enabling customers to manage the impact of network worms and virus threats.
computer consulting Tucson Silveradotech.com provides technological consulting and network solutions for southern Arizona businesses and individuals. Tucson SEO We provide Tucson and Phoenix with Web Design, Hosting, Internet Marketing and SEO. Our search engine optimized websites will rank well and increase business. perspex display stands UK based supplier of a large range of plastic materials used in custom fabrication. Typical material supplied incudes perspex mirror, frosted acrylic, PETG and foam PVC. Creative Writing Courses Creative writing courses, business writing courses and various other writing courses at Oxford Open Learning. Writing School provides skills to write creatively and market your work so you can succeed as a writer.
Let see some of the main kinds of Directives used:
@Page directive:
This is used to define page specific attributes used by ASP.NET page parser and compiler. It can be included only in .aspx files and it also defines the language of the page just like c# and VB.
@Control:
This works much in the same way except that it is used specifically for User Controls. Also included only in .aspx and they control the view state of the page.
@Import:
This one is used to import a namespace into a page or user space. But one directive can import any one namespace only and if there is a need to import more than one then multiple directives will have to be used.
@Implements:
It shows whether the current page or a particular user control follows the specified .NET framework interface or not.
@Register:
This one is a powerful tool which is used to create dynamically creating tags that represent your user controls. It helps to create a tag name and tag prefix to which all the user controls are associated and can be dropped onto a page by just one single simple tag.
@Assembly:
This is used to link an assembly to an application or a web page at parse time. It is contained in either global.asax file, for application-wide linking, or in a page (.aspx) or user control (.ascx) file, for linking to a specific page or user control. Each of these assembly directives can have multiple attribute or value pairs.
@OutputCache:
The OutputCache directive controls output caching for a page or user control.
@Reference:
This one allows you to know that you another page or user control has to be connected with the current page. This gives you access to the controls on the linked page and user control as a part of the Control Collection object.