473,399 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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
Nov 18 '05 #1
2 2376
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" <kr********@spamtrap.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2
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]" <vg*@NOobiesSPAM.com> skrev i meddelandet
news:uv**************@TK2MSFTNGP09.phx.gbl...
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" <kr********@spamtrap.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dan | last post by:
Hi, I have a problem using an aspx page with a Control on it. I get the following error message Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple places; using definition...
1
by: ATJaguarX | last post by:
I have an asp.net web application that I'm having problems with. Everytime I view certain pages in design mode, Sourcesafe asks me to check out the page because of requested changes. When I go to...
3
by: ad | last post by:
I download the source of Portal Starter Kit form http://www.asp.net/Default.aspx?tabindex=8&tabid=47 I find there are Register tag in many .aspx, like this HtmlModule.ascx , the first line is ...
0
by: Mark | last post by:
At the top of my ASP.NET .aspx web page, I have several tags which I've included below. We store our ASP.NET projects in VSS. Every time I open up this project, VSS requires me to check out this...
5
by: serge calderara | last post by:
Dear all, I do not see the difference between Referencing an assembliy for use in my project and Register it on a page ? At the end if I want to use assembly functionnality , I need anyway to...
1
by: Michael Tissington | last post by:
I'm trying to convert a project from VS2003 to VS2005 After conversion all of my TagPrefix are not recognized in the body. <%@ Register TagPrefix="Oaklodge" TagName="Curve"...
8
by: Umut Tezduyar | last post by:
I know that, in asp.net 2.0, the assembly for the web site is splitted into pieces and each time you build it, it generates a random name for assembly. My question is, if i create a custom web...
5
by: richard.tallent | last post by:
I'm fond of web controls in ASP.NET, but the need for <@ Register%> blocks at the top of each page is a pain. ASP.NET 2.0 has a way to centrally register controls in the web.config file, but it...
5
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.