![]() |
|
|
|||||||
![]() |
ASP Net - Register TagPrefix ?? really a good idea? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Ok, so a new question...
Im building my page as dynamic as I can... meaning that I have basicly one aspx page that controls everything... so, I solved this by sending different variables to the page depending on where i want to go, eg. www.myserver.com/gotopage.aspx?page=mainpage ok, so, on this gotopage.aspx I have used a lot of usercontrols to show the defferent contents of my pages (to keep the design at one place and the code in other places...) So to my question... If I use: <%@ Register TagPrefix="uc1" TagName="bottom_info_inc" Src="blabla/bottom_info_inc.ascx" %> <%@ Register TagPrefix="uc1" TagName="bottom2_info_inc" Src="blabla/bottom2_info_inc.ascx" %> <%@ Register TagPrefix="uc1" TagName="bottom3_info_inc" Src="blabla/bottom3_info_inc.ascx" %> <%@ Register TagPrefix="uc1" TagName="bottom4_info_inc" Src="blabla/bottom4_info_inc.ascx" %> <%@ Register TagPrefix="uc1" TagName="bottom5_info_inc" Src="blabla/bottom5_info_inc.ascx" %> <%@ Register TagPrefix="uc1" TagName="bottom6_info_inc" Src="blabla/bottom6_info_inc.ascx" %> and so on on my page, and then in the code control witch control should be used, does this mean that the page is loading the content of each control everytime a user accesses my page? or does it only load the control when the code specifies that that control should be viewed??? so, is it better to just use placeholders, and make the control load entirely in the code? or??? Yours: Kristoffer Kristoffer Arfvidson |
|
|
|
|
#2 |
|
Posts: n/a
|
Hi Kristoffer,
1) If you're only specifying a @ Register directive alone and no corresponding UC tag, that will not add any overhead. 2) If you're declaratively adding all your usercontrols and you show/hide them at runtime based on some logic, that will cause all of your controls to be created at runtime. 3) Dynamically loading only the required user controls at runtime would be a much better option. Let me know if clear things up a bit, -- Victor Garcia Aprea Microsoft MVP | ASP.NET Looking for insights on ASP.NET? Read my blog: http://obies.com/vga/blog.aspx To contact me remove 'NOSPAM'. Please post all questions to the newsgroup "Kristoffer Arfvidson" <> wrote in message news:%... > Ok, so a new question... > Im building my page as dynamic as I can... > meaning that I have basicly one aspx page that controls everything... > so, I solved this by sending different variables to the page depending on > where i want to go, eg. www.myserver.com/gotopage.aspx?page=mainpage > > ok, so, on this gotopage.aspx > > I have used a lot of usercontrols to show the defferent contents of my pages > (to keep the design at one place and the code in other places...) > > So to my question... > If I use: > <%@ Register TagPrefix="uc1" TagName="bottom_info_inc" > Src="blabla/bottom_info_inc.ascx" %> > <%@ Register TagPrefix="uc1" TagName="bottom2_info_inc" > Src="blabla/bottom2_info_inc.ascx" %> > <%@ Register TagPrefix="uc1" TagName="bottom3_info_inc" > Src="blabla/bottom3_info_inc.ascx" %> > <%@ Register TagPrefix="uc1" TagName="bottom4_info_inc" > Src="blabla/bottom4_info_inc.ascx" %> > <%@ Register TagPrefix="uc1" TagName="bottom5_info_inc" > Src="blabla/bottom5_info_inc.ascx" %> > <%@ Register TagPrefix="uc1" TagName="bottom6_info_inc" > Src="blabla/bottom6_info_inc.ascx" %> > > and so on on my page, and then in the code control witch control should be > used, does this mean that the page is loading the content of each control > everytime a user accesses my page? > or does it only load the control when the code specifies that that control > should be viewed??? > > so, is it better to just use placeholders, and make the control load > entirely in the code? or??? > > Yours: Kristoffer > > Victor Garcia Aprea [MVP] |
|
|
|
#3 |
|
Posts: n/a
|
ok, I used a placeholder to show two different designs and it was alot of
different controls in each placeholder... Each control was placed with UC tag and the placeholder was set visible=false however, I noticed a significiant decreese in performance, when I had a large script in one of the placeholders... After replacing that script with a dynamicly control = loadcontrol("") in the code, the whole page was turned to speedy gonsales... Thanks for your reply... Yours: Kristoffer "Victor Garcia Aprea [MVP]" <> skrev i meddelandet news:... > Hi Kristoffer, > > 1) If you're only specifying a @ Register directive alone and no > corresponding UC tag, that will not add any overhead. > 2) If you're declaratively adding all your usercontrols and you show/hide > them at runtime based on some logic, that will cause all of your controls to > be created at runtime. > 3) Dynamically loading only the required user controls at runtime would be a > much better option. > > Let me know if clear things up a bit, > > -- > Victor Garcia Aprea > Microsoft MVP | ASP.NET > Looking for insights on ASP.NET? Read my blog: > http://obies.com/vga/blog.aspx > To contact me remove 'NOSPAM'. Please post all questions to the newsgroup > > "Kristoffer Arfvidson" <> wrote in message > news:%... > > Ok, so a new question... > > Im building my page as dynamic as I can... > > meaning that I have basicly one aspx page that controls everything... > > so, I solved this by sending different variables to the page depending on > > where i want to go, eg. www.myserver.com/gotopage.aspx?page=mainpage > > > > ok, so, on this gotopage.aspx > > > > I have used a lot of usercontrols to show the defferent contents of my > pages > > (to keep the design at one place and the code in other places...) > > > > So to my question... > > If I use: > > <%@ Register TagPrefix="uc1" TagName="bottom_info_inc" > > Src="blabla/bottom_info_inc.ascx" %> > > <%@ Register TagPrefix="uc1" TagName="bottom2_info_inc" > > Src="blabla/bottom2_info_inc.ascx" %> > > <%@ Register TagPrefix="uc1" TagName="bottom3_info_inc" > > Src="blabla/bottom3_info_inc.ascx" %> > > <%@ Register TagPrefix="uc1" TagName="bottom4_info_inc" > > Src="blabla/bottom4_info_inc.ascx" %> > > <%@ Register TagPrefix="uc1" TagName="bottom5_info_inc" > > Src="blabla/bottom5_info_inc.ascx" %> > > <%@ Register TagPrefix="uc1" TagName="bottom6_info_inc" > > Src="blabla/bottom6_info_inc.ascx" %> > > > > and so on on my page, and then in the code control witch control should be > > used, does this mean that the page is loading the content of each control > > everytime a user accesses my page? > > or does it only load the control when the code specifies that that control > > should be viewed??? > > > > so, is it better to just use placeholders, and make the control load > > entirely in the code? or??? > > > > Yours: Kristoffer > > > > > > Kristoffer Arfvidson |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need examples of GOOD Anime | Geo H | DVD Video | 84 | 05-20-2008 06:04 AM |
| OFF TOPIC but a good question I think. | me | A+ Certification | 8 | 05-15-2005 01:37 PM |
| Re: recommend a good interactive cdrom/online training course? | Anthony | A+ Certification | 2 | 09-04-2004 08:35 AM |
| What a good idea | Walter A+ | A+ Certification | 6 | 11-06-2003 06:47 PM |
| Re: 7. The truth about our creator. .7 | john smith | DVD Video | 2 | 07-25-2003 03:54 AM |