Results 1 to 9 of 9

Thread: [RESOLVED] Common controls to register

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Resolved [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.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    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?

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    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.

  5. #5
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    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

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    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?

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  8. #8
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    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...

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Common controls to register

    Quote 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
  •  



Click Here to Expand Forum to Full Width