Click here to Skip to main content
15,885,278 members
Articles / Web Development / ASP.NET

PageManager control for ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.50/5 (10 votes)
27 Oct 2010CPOL2 min read 48.9K   635   34   13
PageManager is a web server control which allows developers to easily integrate jQuery and JavaScript files.

Introduction

PageManager is a web server control which allows developers to easily integrate jQuery and JavaScript files in ASP.NET Web applications.

PageManager control is included in the Extensible Web Toolkit (XWT). Please download the Toolkit in order to use PageManager control:

The key features of the PageManager control are:

  • jQuery support PageManager control includes the latest jQuery file.
  • jQuery CDN supportPageManager control includes the latest CDN URL.
  • Custom JavaScript files inclusion – You can include your own JavaScript files in PageManager control.
  • Web.config file support – All the PageManager control’s functionality can be easily implement through web.config file.

Example - jQuery Support

Latest jQuery library (1.4.2) is integrated into the PageManager control.

Drag and drop PageManager control into an ASP.NET page and start writing jQuery code.

Write a simple jQuery function and view in the browser:

Example – jQuery CDN Support

You can use CDN for jQuery by simply setting the EnableCDN property to true. This can be done for a specific ASP.NET page or for the entire application using the web.config file. You can also change the CDN URL by using setting the CDNUrl property. CDN support is disabled by default however.

Example – Custom JavaScript Files Inclusion

You can include any JavaScript file using Scripts property. This can be done for the entire application through web.config file as well.

You can also enable/disable a particular script file using Enable property.

Example - Using web.config File to Setup PageManager for the Entire Application

All the following functionalities can be done using web.config file. However, these settings can be overridden by the ASP.NET page's PageManager settings.

  • Add a different jQuery file
  • Enable/Disable jQuery file
  • Enable/Disable jQuery CDN
  • Set jQuery CDN URL
  • Add JavaScript files
  • Enable/Disable individual JavaScript file

Settings in customScripts section:

  • enable - Enable/disable all the script files
  • CDNUrl – URL for the CDN location
  • EnableCDN - Enable/disable CDN
  • JQueryFile - jQuery file to be used

Settings in scripts section:

  • id - File Id
  • path - Path for the script file
  • enable - Enable/disable script file include

In order to use PageManager control in web.config, you must first add the configuration section as shown in the following screen capture:

You can also add JavaScript files for the entire application using scripts section as shown in the following screen capture:

Conclusion

PageManager control can be useful when you write script intensive web applications. It includes latest jQuery file and JavaScripts can be managed by the web.config. There are many more other useful and lightweight controls in XWT. You can download the complete XWT toolkit from here.

Read more on Extensible Web Toolkit:

Update

Please read the following article on MessageControl--another XWT control which lets you display user messages like in Gmail application:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Singapore Singapore
Ludmal is a Software Architect, technical author and trainer with over 10 years experience in the software development industry. He is a MCPD and MCTS on enterprise application development. He mainly researches on SOA & Web performance. You can read his blog at www.ludmal.net and e-mail him at ludmal@gmail.com. Twitter @ludmal

Comments and Discussions

 
GeneralMy vote of 2 Pin
robvon26-Oct-10 8:52
robvon26-Oct-10 8:52 
GeneralIts CodeProject not PromoProject Pin
robvon26-Oct-10 8:51
robvon26-Oct-10 8:51 
GeneralRe: Its CodeProject not PromoProject Pin
Ludmal de silva26-Oct-10 21:22
Ludmal de silva26-Oct-10 21:22 
GeneralInteresting Pin
Yves25-Oct-10 12:25
Yves25-Oct-10 12:25 
GeneralRe: Interesting Pin
Ludmal de silva25-Oct-10 14:49
Ludmal de silva25-Oct-10 14:49 
GeneralRe: Interesting Pin
Yves28-Oct-10 14:32
Yves28-Oct-10 14:32 
GeneralRe: Interesting Pin
Ludmal de silva28-Oct-10 22:28
Ludmal de silva28-Oct-10 22:28 
GeneralMy vote of 1 Pin
vgirimtech24-Oct-10 20:42
vgirimtech24-Oct-10 20:42 
GeneralIncomplete Article Pin
Venkatesh Mookkan21-Oct-10 17:12
Venkatesh Mookkan21-Oct-10 17:12 
GeneralRe: Incomplete Article Pin
Ludmal de silva21-Oct-10 19:25
Ludmal de silva21-Oct-10 19:25 
GeneralMy vote of 5 Pin
ChannaJ*21-Oct-10 14:52
ChannaJ*21-Oct-10 14:52 
GeneralMy vote of 5 Pin
Eric Xue (brokensnow)21-Oct-10 11:05
Eric Xue (brokensnow)21-Oct-10 11:05 
interesting .net server control! thanks for sharing
GeneralImages Pin
crb900021-Oct-10 8:35
crb900021-Oct-10 8:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.