Main Menu
Knowledge Base
Product Registration
Log an Incident
Request a Feature
Search Incidents/Bug Reports


Search KB

Please note: In an effort to better serve you, we are in the process of restructuring DevCenter. In the process, we have moved many items that you may be used to finding in DevCenter over to the Main Site. If you are having trouble locating something, please try looking at the following places:

Knowledge Base Article: KB09982

HOWTO:Basics of using Infragistics controls in Master and Content pages


The information in this article applies to:
ASP.NET (v5.3.20053, 6.1.20061, 6.2.20062, 6.3.20063, 7.1.20071, 7.2.20072)
  Article Created: 
7/17/2006

Last Updated:
9/13/2007

Article Type
How To
  
Page Options
Average Rating:
3 out of 10

Rate this page
Print this page
E-mail this page
Add to Favorites

Summary

With the release of .NET 2.0, a new feature was added for use in ASP.NET applications called Master pages. A webpage that uses a Master page is called a Content page. By having several Content pages share the same Master page, the website can have a consistent look and feel. This article explains the basics of using Infragistics controls in a website that uses Master and Content pages, focusing on how the controls can be accessed both on the client and on the server.

Additional Information

An MSDN article explains the basics of creating and configuring Master and Content pages. You can access this article via the following link: http://msdn.microsoft.com/asp.net/reference/ui/default.aspx?pull=/library/en-us/dnvs05/html/masterpages.asp

Please note that the above article is neither authored nor maintained by Infragistics.

The sample for this article shows different scenarios that the controls can be in. Scenarios demonstrated in the sample include:

1)    Basic Content page showing how to bind data to a WebGrid located on the Master page.
2)    Getting the Client ID of a control on a Content page for use in a utility function called on the Content page.
3)    Getting the Client ID of a control on a Master page for use in a utility function called on the Content page.

You will want to use "Main.aspx" as the starting page when you run the sample.

Step-By-Step Example

Because Master page functionality makes use of naming containers, this will need to be taken into account when performing client-side functionality. The NetAdvantage utility functions used to access the objects on the client need the Client ID generated for the control. Controls that are inside of a naming container will have their Client ID changed by the naming container, instead of using the control's regular ID. The sample demonstrates how you can handle an Initialize client-side event for the controls to get access to the ID that was generated. This ID can then be stored in a variable for later use.

Server-side events set on the Master page are raised on each of the Content pages. This allows common functionality to exist throughout each Content page, while being stored in only one location. When a page is set to use a Master page, the Master page can be accessed from the Content page, by using its Page.Master property. With access to the Master page, you can obtain a reference to a control on it using the server-side FindControl() method. With access to the control, it can be modified for the specific Content page by attaching more event handlers and by setting properties.

Related Articles

HOWTO: Techniques for getting the client-side ID of a NetAdvantage ASP.NET control inside of a WebTab (KB09693)

Samples

using_masterpages_cs.zip
 Demonstrates how to access NetAdvantage controls in a Master-Content page scenario.


using_masterpages_vb.zip
 Demonstrates how to access NetAdvantage controls in a Master-Content page scenario.



How would you rate the quality of this content?
Poor -----------------------------------------> Outstanding

Tell us why you rated the content this way. (optional)