Master Pages Great! But what about Master User Controls?

Discussion in 'ASP .Net' started by Electrified Research, Oct 10, 2005.

  1. >From ASP.NET 1.1 I have a very useful UserControl which acts like a
    template control. I call it a CustomTemplate.

    Basically it gives me a re-usable look to sections of the site without
    having to tinker with HTML. This is very much like what is being done
    by Master Pages but with a User Control.

    I have a two part question:
    1. Is there some magical new way to do this in ASP.NET 2.0 and have it
    show up nice in Design Mode?
    2. If not how can I create a re-usable, easy as editing a UserControl
    like template which Design Mode will render nicely.

    Thanks.
     
    Electrified Research, Oct 10, 2005
    #1
    1. Advertising

  2. Electrified Research

    clintonG Guest

    They claim Master Pages are supported in the designer but that has proven a
    partial truth.
    For example, nested Masters do not render in the designer. Other aspects of
    page design such as the use of various uses of CSS will not render in the
    designer either. Its a bit disconcerting at first but I've become used to
    it.

    The answer to your second question is to put your water wings on and jump in
    but be prepared to live the life of the pioneering spirit.

    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL http://metromilwaukee.com/
    URL http://clintongallagher.metromilwaukee.com/


    "Electrified Research" <> wrote in message
    news:...
    > >From ASP.NET 1.1 I have a very useful UserControl which acts like a

    > template control. I call it a CustomTemplate.
    >
    > Basically it gives me a re-usable look to sections of the site without
    > having to tinker with HTML. This is very much like what is being done
    > by Master Pages but with a User Control.
    >
    > I have a two part question:
    > 1. Is there some magical new way to do this in ASP.NET 2.0 and have it
    > show up nice in Design Mode?
    > 2. If not how can I create a re-usable, easy as editing a UserControl
    > like template which Design Mode will render nicely.
    >
    > Thanks.
    >
     
    clintonG, Oct 11, 2005
    #2
    1. Advertising

  3. Electrified Research

    clintonG Guest

    <snip />

    Sorry, I forgot to explain, the Master Page becomes the user control.

    <%= Clinton Gallagher
     
    clintonG, Oct 11, 2005
    #3
  4. Re: Master Pages Great! But what about Master User Controls?

    So you can use Master Pages as Master User Controls and not just Pages?
     
    Electrified Research, Oct 11, 2005
    #4
  5. > 1. Is there some magical new way to do this in ASP.NET 2.0 and have it
    > show up nice in Design Mode?


    No magical way. The Master Page functionality sets up a "server control"
    that renders the common elements. The IDE rendering the control is based
    solely on the programmers allowing this. There is currently no magic way to
    set up your own control to do this. Migrating to a master page would be the
    easiest, if possible.

    If not possible, consider creating a compiled server control, as it will
    render, according to the Render() method, in the IDE. YOu can then template
    the Page and start using your new page template for all new pages.

    > 2. If not how can I create a re-usable, easy as editing a UserControl
    > like template which Design Mode will render nicely.


    I know of no way to set up a control that allows drag and drop and renders
    in the design surface. Perhaps this is something Microsoft can look at in the
    future. Barring that, you would have to create your own designer for your
    custom control, which is a lot of work if you ask me.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***************************
    Think Outside the Box!
    ***************************


    "Electrified Research" wrote:

    > >From ASP.NET 1.1 I have a very useful UserControl which acts like a

    > template control. I call it a CustomTemplate.
    >
    > Basically it gives me a re-usable look to sections of the site without
    > having to tinker with HTML. This is very much like what is being done
    > by Master Pages but with a User Control.
    >
    > I have a two part question:
    > 1. Is there some magical new way to do this in ASP.NET 2.0 and have it
    > show up nice in Design Mode?
    > 2. If not how can I create a re-usable, easy as editing a UserControl
    > like template which Design Mode will render nicely.
    >
    > Thanks.
    >
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Oct 11, 2005
    #5
  6. Re: Master Pages Great! But what about Master User Controls?

    No exactly. Master pages are coded like user controls and inherit from the
    control hierarchy in the BCL. That is what Clinton was talking about.

    There is no master user control set up, but it is a good idea for future
    endeavors. :)

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***************************
    Think Outside the Box!
    ***************************


    "Electrified Research" wrote:

    > So you can use Master Pages as Master User Controls and not just Pages?
    >
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Oct 11, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack Schafer
    Replies:
    1
    Views:
    545
    Joe Smith
    Apr 23, 2004
  2. Replies:
    1
    Views:
    3,262
    PeterKellner
    May 16, 2006
  3. Nathan Sokalski
    Replies:
    5
    Views:
    1,064
    Gaurav Vaish \(www.Edujini-Labs.com\)
    Jan 10, 2007
  4. Nathan Sokalski
    Replies:
    4
    Views:
    328
    Nathan Sokalski
    Dec 21, 2006
  5. Eric I.
    Replies:
    0
    Views:
    282
    Eric I.
    Oct 5, 2008
Loading...

Share This Page