is it bad pratice to call multiple controls using one aspx page

T

thedebugger

Dear Friends,
I am working on website application in c# with asp.net.
My practice using aspx files is, I have 1 main aspx files for inside pages.
Whenever user hit the button like aboutus, contactus and similar buttons,
also any other button from menu, it always call contentDisplay.aspx,
including pageid and other ids depending upon contents.

for example,
aboutus button contain the url like contentDisplay.aspx?pageid=2
contactus button : contentDisplay.aspx?pageid=3

then I am including the controls in middle of contentDisplay.aspx page,
depending upon the pageid I am getting, eg. if pageid=3 then about.ascx etc.

My question is, is this a good and right practice? or there is another
professional way. Because if my website is small, its working pefectly. but
for large userbase website, its going on toss.

Need experts comments. Hope this info is enough. If you need more info, tell
me.

Regards
Sachin Korgaonkar
 
H

Hans Kesting

thedebugger said:
Dear Friends,
I am working on website application in c# with asp.net.
My practice using aspx files is, I have 1 main aspx files for inside
pages. Whenever user hit the button like aboutus, contactus and
similar buttons, also any other button from menu, it always call
contentDisplay.aspx, including pageid and other ids depending upon
contents.

for example,
aboutus button contain the url like contentDisplay.aspx?pageid=2
contactus button : contentDisplay.aspx?pageid=3

then I am including the controls in middle of contentDisplay.aspx
page, depending upon the pageid I am getting, eg. if pageid=3 then
about.ascx etc.

My question is, is this a good and right practice? or there is another
professional way. Because if my website is small, its working
pefectly. but for large userbase website, its going on toss.

Need experts comments. Hope this info is enough. If you need more
info, tell me.

Regards
Sachin Korgaonkar

That's how we do it. It works fine.
We use a configuration file that translates that "pageid" into an ascx to use,
then we use LoadControl to get it and attach it to a defined PlaceHolder.

A previous version included all ascx'es and switched off all that were not needed,
but this quickly got too complicated as the applications grew.

Hans Kesting
 
G

Guest

I think it's a better solution to make a page with frames and to make link
buttons with javascript on it in which to open an aspx page on a target
frame.
This way you will not have reload all the page (which can transfer some
stuff which can have some extra bytes). This way you'll have to load only the
target frame.

hope helps
Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top