Home All Groups Group Topic Archive Search About

Master Pages Great! But what about Master User Controls?

Author
10 Oct 2005 10:29 PM
Electrified Research
>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.

Author
11 Oct 2005 12:46 AM
clintonG
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/


Show quoteHide quote
"Electrified Research" <researc***@electrified.net> wrote in message
news:1128983376.848135.290350@g14g2000cwa.googlegroups.com...
> >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.
>
Are all your drivers up to date? click for free checkup

Author
11 Oct 2005 12:47 AM
clintonG
<snip />

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

<%= Clinton Gallagher
Author
11 Oct 2005 6:41 AM
Electrified Research
So you can use Master Pages as Master User Controls and not just Pages?
Author
11 Oct 2005 2:32 PM
Cowboy (Gregory A. Beamer) - MVP
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!
***************************


Show quoteHide quote
"Electrified Research" wrote:

> So you can use Master Pages as Master User Controls and not just Pages?
>
>
Author
11 Oct 2005 2:30 PM
Cowboy (Gregory A. Beamer) - MVP
> 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!
***************************


Show quoteHide quote
"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.
>
>

Bookmark and Share