473,387 Members | 1,745 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,387 software developers and data experts.

VB.Net Template Idea Suggestions

Hi,

I spent the entire weekend struggling to find a suitable tempalte solution
for my site. Yes, user controls were good, but I needed one page that could
control user controls on each adn every page of my site. Unfortuentaly, I
was not able to find a solution to that, and have resorted to loading each
control on each page individually.

However, I was talking to a friend who also designs in .Net, and he came up
with this idea, and I wanted to get some opinions on it.

Instead of having 100 aspx pages and loading user controls into them, have 1
aspx page with a placeholder, and load 100 ascx pages into them when needed.
So default.aspx?page=1 would load page 1.ascx into the placeholder.
default.aspx?page=99 would load page 99 into the placeholder. Therefor, I
would only have one main page to control and keep track of, whereas all
additional pages would be loaded when needed.

Any downsides to this?

Thanks!
Nov 17 '05 #1
4 1297
You could have a base class that renders()'s the template and derive each
page from this class and call the abstract "AddControls" method from the
base class which is overridden in the dervied class, adds the controls
specific to that page and writes out the rest of the template.

I ran into a similar issue and found a way to use oo and usercontrols to
acheive this site wide and a bit more (using some of the techniques
discussed above), but it is still under development just now.

regards,
steven
http://www.stevenlivingstone.com
http://www.venturetogether.org

"Jordan Marton" <JM*****@NOSPAMmarketaxess.com> wrote in message
news:OB**************@TK2MSFTNGP11.phx.gbl...
Hi,

I spent the entire weekend struggling to find a suitable tempalte solution
for my site. Yes, user controls were good, but I needed one page that could control user controls on each adn every page of my site. Unfortuentaly, I
was not able to find a solution to that, and have resorted to loading each
control on each page individually.

However, I was talking to a friend who also designs in .Net, and he came up with this idea, and I wanted to get some opinions on it.

Instead of having 100 aspx pages and loading user controls into them, have 1 aspx page with a placeholder, and load 100 ascx pages into them when needed. So default.aspx?page=1 would load page 1.ascx into the placeholder.
default.aspx?page=99 would load page 99 into the placeholder. Therefor, I
would only have one main page to control and keep track of, whereas all
additional pages would be loaded when needed.

Any downsides to this?

Thanks!

Nov 17 '05 #2
In theory, that's a good idea, but I see a few issues:
1. How do you know to load #99 vs #98? In other words how are you going to
keep track of all of these different User controls? Maybe numbering them is
a bad idea. Maybe naming them something more "human readable" would be
better.

2. If you are not doing this in frames, a user could manipulate your URL
and go to undesirable places, or break the flow of your site.

Michael
"Jordan Marton" <JM*****@NOSPAMmarketaxess.com> wrote in message
news:OB**************@TK2MSFTNGP11.phx.gbl...
Hi,

I spent the entire weekend struggling to find a suitable tempalte solution
for my site. Yes, user controls were good, but I needed one page that could control user controls on each adn every page of my site. Unfortuentaly, I
was not able to find a solution to that, and have resorted to loading each
control on each page individually.

However, I was talking to a friend who also designs in .Net, and he came up with this idea, and I wanted to get some opinions on it.

Instead of having 100 aspx pages and loading user controls into them, have 1 aspx page with a placeholder, and load 100 ascx pages into them when needed. So default.aspx?page=1 would load page 1.ascx into the placeholder.
default.aspx?page=99 would load page 99 into the placeholder. Therefor, I
would only have one main page to control and keep track of, whereas all
additional pages would be loaded when needed.

Any downsides to this?

Thanks!

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/2003
Nov 17 '05 #3
Well more precisely...

www.mydomain.com/default.aspx would be the main page.

Then default.aspx?page=new_user would dynamically load the new user control
into a panel. And default.aspx?page=contact would load a contact form. It
doesn't have to be based on numbers, or pages can be by numbers and I can
use a nice big select statement to get the right page, or link the number to
a table in a database and pull the correct user control file...

If the page wasn't found, a special user control could be loaded...

Jordan

"Michael Pearson" <mi************************@televox.com> wrote in message
news:Ov**************@TK2MSFTNGP11.phx.gbl...
In theory, that's a good idea, but I see a few issues:
1. How do you know to load #99 vs #98? In other words how are you going to keep track of all of these different User controls? Maybe numbering them is a bad idea. Maybe naming them something more "human readable" would be
better.

2. If you are not doing this in frames, a user could manipulate your URL
and go to undesirable places, or break the flow of your site.

Michael
"Jordan Marton" <JM*****@NOSPAMmarketaxess.com> wrote in message
news:OB**************@TK2MSFTNGP11.phx.gbl...
Hi,

I spent the entire weekend struggling to find a suitable tempalte solution for my site. Yes, user controls were good, but I needed one page that could
control user controls on each adn every page of my site. Unfortuentaly, I was not able to find a solution to that, and have resorted to loading each control on each page individually.

However, I was talking to a friend who also designs in .Net, and he came

up
with this idea, and I wanted to get some opinions on it.

Instead of having 100 aspx pages and loading user controls into them, have 1
aspx page with a placeholder, and load 100 ascx pages into them when

needed.
So default.aspx?page=1 would load page 1.ascx into the placeholder.
default.aspx?page=99 would load page 99 into the placeholder. Therefor,

I would only have one main page to control and keep track of, whereas all
additional pages would be loaded when needed.

Any downsides to this?

Thanks!

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/2003

Nov 17 '05 #4
Well, I guess that's just as good an idea as any. I'm not sure I like the
giant select case. I suspect that's going to be a bear to maintain
depending on how many items you have in your select list.

Good luck with it man!

Michael
"Jordan Marton" <JM*****@NOSPAMmarketaxess.com> wrote in message
news:ej**************@TK2MSFTNGP12.phx.gbl...
Well more precisely...

www.mydomain.com/default.aspx would be the main page.

Then default.aspx?page=new_user would dynamically load the new user control into a panel. And default.aspx?page=contact would load a contact form. It
doesn't have to be based on numbers, or pages can be by numbers and I can
use a nice big select statement to get the right page, or link the number to a table in a database and pull the correct user control file...

If the page wasn't found, a special user control could be loaded...

Jordan

"Michael Pearson" <mi************************@televox.com> wrote in message news:Ov**************@TK2MSFTNGP11.phx.gbl...
In theory, that's a good idea, but I see a few issues:
1. How do you know to load #99 vs #98? In other words how are you going
to
keep track of all of these different User controls? Maybe numbering them
is
a bad idea. Maybe naming them something more "human readable" would be
better.

2. If you are not doing this in frames, a user could manipulate your
URL and go to undesirable places, or break the flow of your site.

Michael
"Jordan Marton" <JM*****@NOSPAMmarketaxess.com> wrote in message
news:OB**************@TK2MSFTNGP11.phx.gbl...
Hi,

I spent the entire weekend struggling to find a suitable tempalte solution for my site. Yes, user controls were good, but I needed one page that

could
control user controls on each adn every page of my site. Unfortuentaly, I
was not able to find a solution to that, and have resorted to loading each control on each page individually.

However, I was talking to a friend who also designs in .Net, and he
came up
with this idea, and I wanted to get some opinions on it.

Instead of having 100 aspx pages and loading user controls into them,
have
1
aspx page with a placeholder, and load 100 ascx pages into them when

needed.
So default.aspx?page=1 would load page 1.ascx into the placeholder.
default.aspx?page=99 would load page 99 into the placeholder.

Therefor, I would only have one main page to control and keep track of, whereas

all additional pages would be loaded when needed.

Any downsides to this?

Thanks!

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/2003
Nov 17 '05 #5

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

Similar topics

7
by: zhou | last post by:
Hi there, We have a compiler specific issue which requires us to force template instantiation. This works fine. The problem comes when I try using std:find() on vector. Since vector has no member...
1
by: SpeedBump | last post by:
This is mostly just another "gee it would be nice if it had X" post. Recently I have come across two separate problems which both exhibit the need for a way to self reference when instantiating a...
6
by: NKOBAYE027 | last post by:
FIRST POST Hi All: I'm trying to write a simple specialization before moving on to something a bit more complex - always a good idea in my case, at least. :o) I'm trying to adapt the example...
12
by: James Brown | last post by:
Hi all, Having problems designing a template-class. I'll describe my scenario first then show what I've come up with so far: Need a class to provide pointer/array-like access to an area of...
2
by: James Brown | last post by:
Hi again, I'm referring back to my previous posting of the same title, with everyone's help I've now got a better understanding of what my goals are and I have a class which now looks like: ...
2
by: Steven T. Hatton | last post by:
While thunbing through _C++ Templates, The Complete Guide_ (reckon I aught to read it?) I came across a discussion of using templates to "unroll" loops. I thought that looked like a good idea, so...
4
by: wkaras | last post by:
I would like to propose the following changes to the C++ Standard, the goal of which are to provide an improved ability to specify the constraints on type parameters to templates. Let me say from...
0
by: MattB | last post by:
I got a response earlier, but I thought I'd bump this one to the top for a quick answer. Any tips, suggestions, or especially examples would be great! It seems like I may be able to do this...
4
by: Brian Barnes | last post by:
I am trying to create a template code behind file for a website which all pages should be inherited from. This base class however, when I try to view the aspx page in Visual studio .NET (2002), it...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.