|
-
Jul 27th, 2007, 11:23 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Common controls to register
Hello is there an easy way to accomplish there, please provide your insight.
I have a webpage that I have a banner and couple navigation menus. Its layout is like this:
Banner1 page
Navigation Menus go here
<img src=banner1.jpg />
Navigation menus go here
Banner2 page
Navigation Menus go here
<img src=banner2.jpg />
Navigation menus go here
and so on.. the navigation menus are gonig to stay the same but the banner is different according to the page.
My question is, i want to make these as common controls, which I can just register and call them so that in the future, it would be easier to modify and so forth (i.e the navigation menus on top and bottom of the banner image) Is there a way to accomplish this? Like if the page displays this, then the banner should be this? like an if statement, but I am looking for some suggestions.
-
Jul 27th, 2007, 11:29 AM
#2
Re: Common controls to register
Are you using VS 2005? If so, do a search on Master Pages. It should light up a bulb in your mind, because you'll most likely understand exactly what you have to do.
-
Jul 27th, 2007, 12:40 PM
#3
Thread Starter
Frenzied Member
Re: Common controls to register
But don't you think that's still not very efficient? I meant what if in the future, I want to change the layout of Master page (right now I have master1.master and master2.master). I created master2.master by copied and pasted from master1. In the future, I want to change the layout, then I have to go into each mater pages to change the layout and code? or there's a solution to that?
-
Jul 27th, 2007, 02:45 PM
#4
Thread Starter
Frenzied Member
Re: Common controls to register
Oh and I just figure this more and I don't think master page is the one that I want because the content is fixed everytime the mater page got changed, which I don't want the content control to be fixed.
-
Jul 27th, 2007, 02:59 PM
#5
Re: Common controls to register
The idea of master pages is to provide consistency for any number of pages underneath them. Per your example, you would create a master page containing the top nav bar, a content placeholder, and your bottom nav bar, in that order. Then you would simply create new pages and tell them to use that master page, and put whatever you want inside each page. When you visit the site, the top and bottom navs will always appear, regardless of what's inside them
-
Jul 27th, 2007, 03:41 PM
#6
Thread Starter
Frenzied Member
Re: Common controls to register
hm.. not quite. In my example, in fact, is the top banner, which means I want to make it as a ascx file that I can register. Can I use a master page as an ascx file, then register that file to my index.aspx?
-
Jul 28th, 2007, 10:21 AM
#7
Re: Common controls to register
Your master page need not have anything 'hardcoded' in it. You can specify each control as a web user control (.ascx) which you then place on the MasterPage. The codebehind for your ASCXs should contain the logic it needs to display whatever is 'different'.
If in the future you want to change the layout, you're going to have to change something, you can't expect the website to read your mind and change itself.
-
Jul 30th, 2007, 01:58 PM
#8
Re: Common controls to register
I've tried that... doesn't work too well... in fact, I'm thinking about VBF's color scheme changing to black and blue right now, and it's not doing a lot of changing.. maybe after I submit this message...
-
Aug 1st, 2007, 10:24 AM
#9
Re: Common controls to register
 Originally Posted by timeshifter
I've tried that... doesn't work too well... in fact, I'm thinking about VBF's color scheme changing to black and blue right now, and it's not doing a lot of changing.. maybe after I submit this message...
You ought to register that bug on the vBulletin website.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|