Exploring the depths and potentials of ASP.NET RSS 2.0 or Subscribe to .BenRush by Email
 Tuesday, March 20, 2007

One caveat to using the ScriptManager on your pages is that you can only have one ScriptManager reference at a time. What if you are writing a content page for a master page that has a ScriptManager on it; but you need to now make sure that the ScriptManager references a particular service your content page needs - what do you do? You could check out the MaterPage and make the necessary modifications - but why? That's actually not a very good idea because it kind of breaks the whole concept of master/content page seperation; especially in scenarios where a certain developer can't or shouldn't have access to the master page (say you're farming a particular content page out to a consultant, etc).

The answer when you need to reference a service from your content page and yet the ScriptManager resides on the MasterPage is a ScriptManagerProxy. The ScriptManagerProxy works by detecting the main (real) ScriptManager on your page at runtime and hooking itself to that ScriptManager, making sure that any references given to it are also given to the real ScriptManager. In fact, it's constructor takes a real ScriptManager as a parameter:

internal ScriptManagerProxy(IScriptManagerInternal scriptManager)
{
    this._scriptManager = scriptManager;
}
...and it's OnInit method (called by the ASP.net page framework when the page is being built) is where the proxy registers itself with the page's real ScriptManager:

protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    if (!base.DesignMode)
    {
        this.ScriptManager.RegisterProxy(this);
    }
}
As a result of this registration, when the real ScriptManager builds all references for Services during OnPagePrePrenderComplete, its RegisterServices() method will collect all service references from registered ScriptManagerProxies....

    if (this._proxies != null)
    {
        foreach (ScriptManagerProxy proxy in this._proxies)
        {
            proxy.RegisterServices(this);
        }
    }


kick it on DotNetKicks.com
Tuesday, March 20, 2007 10:31:11 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
AJAX | ASP.Net | Programming
Tracked by:
http://freewebs.com/aspxfaq/06/sitemap15.html [Pingback]
http://freewebs.com/toltom/14/sitemap8.html [Pingback]
http://freewebs.com/toltom/02/ford-trucks.html [Pingback]
http://freewebs.com/toltom/09/sitemap3.html [Pingback]
http://freewebs.com/toltom/14/www-providence-jobs-com.html [Pingback]
"http://kevruublog.tripod.com/96.html" (http://kevruublog.tripod.com/96.html) [Pingback]
"http://fartooblog.tripod.com/111.html" (http://fartooblog.tripod.com/111.html) [Pingback]
"http://vyz07b.org/sitemap8.html" (http://vyz07b.org/sitemap8.html) [Pingback]
"http://awlelm.org/cowgirl-pussy.html" (http://awlelm.org/cowgirl-pussy.html) [Pingback]
"http://topslots.nl.eu.org/01/sitemap11.html" (http://topslots.nl.eu.org/01/site... [Pingback]
"http://freewebs.com/amexa/41/index.html" (http://freewebs.com/amexa/41/index.ht... [Pingback]
"http://freewebs.com/amexa/29/sitemap18.html" (http://freewebs.com/amexa/29/site... [Pingback]
"http://freewebs.com/amexa/21/sprite-airlines.html" (http://freewebs.com/amexa/2... [Pingback]
"http://pinofranc.homestead.com/00/message-board.html" (http://pinofranc.homeste... [Pingback]
"http://pinofranc.homestead.com/00/customer-service-from-home.html" (http://pino... [Pingback]
"http://pinofranc.homestead.com/05/american-airlines-flight-schedules.html" (htt... [Pingback]
"http://kfpye-xxx.com/halle-berry-uncensored.html" (http://kfpye-xxx.com/halle-b... [Pingback]
"http://i3o1o-www.com/dog-booties.html" (http://i3o1o-www.com/dog-booties.html) [Pingback]
"http://caploonews.tripod.com/111.html" (http://caploonews.tripod.com/111.html) [Pingback]
"http://lasduunews.angelfire.com/165.html" (http://lasduunews.angelfire.com/165.... [Pingback]
"http://lasduunews.angelfire.com/102.html" (http://lasduunews.angelfire.com/102.... [Pingback]
"http://ads9z-ooo.com/14-inch-cocks.html" (http://ads9z-ooo.com/14-inch-cocks.ht... [Pingback]
"http://zelkuunews.tripod.com/27.html" (http://zelkuunews.tripod.com/27.html) [Pingback]
"http://xahrf-hhh.com/young-teenage-girls.html" (http://xahrf-hhh.com/young-teen... [Pingback]
"http://hdwkw-xxx.biz/bionca.html" (http://hdwkw-xxx.biz/bionca.html) [Pingback]
"http://r9vod-www.biz/cum-teen.html" (http://r9vod-www.biz/cum-teen.html) [Pingback]
"http://p4g2f-eee.com/teen-boys-underwear.html" (http://p4g2f-eee.com/teen-boys-... [Pingback]
"http://freewebs.com/gremi/04/waterworld-theme-108645.html" (http://freewebs.com... [Pingback]
"http://freewebs.com/gremi/10/the-ghost-of-vincent-price-385901.html" (http://fr... [Pingback]
"http://freewebs.com/tferma/03/merlot-restaurant-ottawa.html" (http://freewebs.c... [Pingback]
"http://freewebs.com/retuv/14/mi-lottery-player-city.html" (http://freewebs.com/... [Pingback]
"http://freewebs.com/amexa/38/sydney-australia-weather.html" (http://freewebs.co... [Pingback]
"http://p5roc-rrr.com/titi.html" (http://p5roc-rrr.com/titi.html) [Pingback]
"http://unibetkom.fw.bz/00845-blog.html" (http://unibetkom.fw.bz/00845-blog.html... [Pingback]
"http://ramambo.nl.eu.org/09/carnival-mycruise.html" (http://ramambo.nl.eu.org/0... [Pingback]
"http://harum.nl.eu.org/tqjunior-advanced-org.html" (http://harum.nl.eu.org/tqju... [Pingback]
"http://harum.nl.eu.org/best-money-market-rates.html" (http://harum.nl.eu.org/be... [Pingback]
"http://grgh1aa.biz/australian-international-lotto.html" (http://grgh1aa.biz/aus... [Pingback]
"http://ri9spbn.biz/massivecocks.html" (http://ri9spbn.biz/massivecocks.html) [Pingback]
"http://jomotkom.nl.eu.org/indian-pussy.html" (http://jomotkom.nl.eu.org/indian-... [Pingback]
"http://homcnla.com/boy-suck.html" (http://homcnla.com/boy-suck.html) [Pingback]
"http://alo--fokom.nl.eu.org/french-toast.html" (http://alo--fokom.nl.eu.org/fre... [Pingback]
"http://nasferablog.netfirms.com/75.html" (http://nasferablog.netfirms.com/75.ht... [Pingback]
"http://obgbtzr.com/gallery-of-supermodels.html" (http://obgbtzr.com/gallery-of-... [Pingback]
"http://qerotblog.nl.eu.org/new-england-train-exchange.html" (http://qerotblog.n... [Pingback]
"http://gmpngp0.biz/bondage-fuck.html" (http://gmpngp0.biz/bondage-fuck.html) [Pingback]
"http://tre--blog.nl.eu.org/windows-95.html" (http://tre--blog.nl.eu.org/windows... [Pingback]
"http://nasferablog.netfirms.com/171.html" (http://nasferablog.netfirms.com/171.... [Pingback]
"http://aqw--blog.nl.eu.org/amc-theaters-deerbrook.html" (http://aqw--blog.nl.eu... [Pingback]
"http://nasferablog.netfirms.com/100.html" (http://nasferablog.netfirms.com/100.... [Pingback]
"http://moko--kom.nl.eu.org/young-shemale.html" (http://moko--kom.nl.eu.org/youn... [Pingback]
"http://rea--kom.nl.eu.org/free-gay-cock-sucking-twink-fucking-cum.html" (http:/... [Pingback]
"http://gada--mene.nl.eu.org/free-nude-couples.html" (http://gada--mene.nl.eu.or... [Pingback]
"http://hadfet--loto.nl.eu.org/http-big-booty-com.html" (http://hadfet--loto.nl.... [Pingback]
"http://nasferablog.netfirms.com/101.html" (http://nasferablog.netfirms.com/101.... [Pingback]
"http://zf1y1fs.biz/lasveagas.com.html" (http://zf1y1fs.biz/lasveagas.com.html) [Pingback]
"http://hjftsic.biz/disneychanne.html" (http://hjftsic.biz/disneychanne.html) [Pingback]
"http://derfoblog.ifrance.com/sitemap4.html" (http://derfoblog.ifrance.com/sitem... [Pingback]
"http://freewebs.com/sruone/discover-aol.html" (http://freewebs.com/sruone/disco... [Pingback]
"http://freewebs.com/sruone/sitemap359.html" (http://freewebs.com/sruone/sitemap... [Pingback]
"http://galetgah.homestead.com/37.html" (http://galetgah.homestead.com/37.html) [Pingback]
"http://aqupofot.nl.eu.org/bone-fish-grill.html" (http://aqupofot.nl.eu.org/bone... [Pingback]
"http://freewebs.com/vuter/05/egypt.html" (http://freewebs.com/vuter/05/egypt.ht... [Pingback]
"http://vuter.homestead.com/01/scooby-doo-com.html" (http://vuter.homestead.com/... [Pingback]
"http://cuter.homestead.com/00/sitemap10.html" (http://cuter.homestead.com/00/si... [Pingback]
"http://duter.homestead.com/01/west-virginia-unclaimed-property.html" (http://du... [Pingback]
"http://freewebs.com/datingblogger/1304.html" (http://freewebs.com/datingblogger... [Pingback]
"http://freewebs.com/datingblogger/1353.html" (http://freewebs.com/datingblogger... [Pingback]
"http://fasxen.netfirms.com/10.html" (http://fasxen.netfirms.com/10.html) [Pingback]
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview

Computers Blogs - Blog Top Sites

Archive
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009
Benjamin Rush
Sign In
Statistics
Total Posts: 444
This Year: 0
This Month: 0
This Week: 0
Comments: 128
Themes
Pick a theme:
All Content © 2009, Benjamin Rush
DasBlog theme 'Business' created by Christoph De Baene (delarou)