| |||||
Content Control SyntaxASP.NET Syntax ASP.NET Syntax for Web Controls Serves to contain a section of content that is rendered to an associated ContentPlaceHolder control in a master page. For information on the individual members of this class, see Content in the class library. RemarksA Content control is essentially a container for the content of a Web Forms page. Like any Web Forms page, a Content control can contain a combination of HTML, ASP.NET server controls, and static text. A Content control, though, is used only with a master page that defines an associated ContentPlaceHolder control, and cannot be used as a stand-alone page.
Syntax ExampleThis site is an actual example of using master pages. This page is actually made up of Content controls, which in turn make up the content of <asp:contentplaceholder> controls defined in the master page file. To see how this page and its master page is done, click here. Notice that there is no reference to the master page file on this page. This is because references to the master page files used on this site are stored in web.config files that cover different subsections of this site. <configuration>
<system.web>
<pages masterPageFile = "~/aspnet/aspnet.master" />
</system.web>
</configuration>
This way, any file ( that includes <asp:content> controls ) within the application boundary covered by the web.config file, automatically use the referenced master page file. See Also |
| ||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme