Tips and Tricks: Page Templates

  • Thread starter Thread starter Cowboy \(Gregory A. Beamer\)
  • Start date Start date
C

Cowboy \(Gregory A. Beamer\)

Here is a little trick that might help some developers.

As you may, or may not, be aware, ASP.NET 2.0 (Whidbey) gives the abilities
to add a master page. This is great news for developers. But, what if you
have an application where you have a skin (the common portion of the page)
created and need to create multiple pages from it ... and are using version
1.0/1.1? While I cannot solve updates with this technique, there is a small
trick you can do to set up pages quickly.

First, create your template. This will have any common user controls, menus,
et al. After you have the page completed, make copy and paste into the
WebProjectsItems folder:

VB:
D:\Program Files\Microsoft Visual Studio .NET
2003\Vb7\VBProjectItems\WebProjectItems

C#
D:\Program Files\Microsoft Visual Studio .NET
2003\VC#\CSharpProjectItems\WebProjectItems

You can then use your add menu to add the item by the name you gave it. If
you work from the standard web template, found at:

You can add your items and have a fully functioning page that adds a class
with the right name.

Now, you can also create full wizards, et al, if you have the time, but this
is a good quick, down and dirty way to repeat a look across a group of pages
(usually at the same directory level, although there are ways around this
too). NOTE: Once again, this is not the same as master page templates. If
you update, you will have to update every page. To reduce updates, use CSS
and user controls for common menus, etc.

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

**********************************************************************
Think Outside the Box!
**********************************************************************
 
...
As you may, or may not, be aware, ASP.NET 2.0 (Whidbey) gives the abilities
to add a master page.

Hi Gregory,

Please excuse my ignorance but when is ASP.Net 2.0 available for a
production server? I am going through hell at the moment trying to
understand how to create a simple template - and if your suggestion in your
post is likely to make it any easier then I might be prepared to ditch my
failing attempts at the moment and wait for an easier approach.

Any information appreciated.

Regards

Rob
 
AFAIK there is no published schedule for the release of ASP.Net 2/Whidbey.
In fact, when you read all the disclaimers about any software, even in the
beta stage, the publisher usually even reserves the option of never
releasing it.

Colin
 
Back
Top