By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,272 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

VB.Net Template Idea Suggestions

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.