Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Register TagPrefix ?? really a good idea?

 
Thread Tools Search this Thread
Old 01-23-2004, 11:53 PM   #1
Default Register TagPrefix ?? really a good idea?


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
  Reply With Quote
Old 01-24-2004, 03:33 AM   #2
Victor Garcia Aprea [MVP]
 
Posts: n/a
Default Re: Register TagPrefix ?? really a good idea?
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]
  Reply With Quote
Old 01-24-2004, 12:16 PM   #3
Kristoffer Arfvidson
 
Posts: n/a
Default Re: Register TagPrefix ?? really a good idea?
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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46