In article <B0**********************************@microsoft.co m>,
MD*@discussions.microsoft.com says...
I have quite a few of web pages in my project which would have similar
appearance (like header, some
images, color, footer etc).
How do i create one base template web page and have all other web pages
derive from it, so that
when i have to do some changes to apperance of all web pages i would just
change base template form,
rather than all web pages.
this seems possible in windows forms but in case of web form where UI is
separated from code behind,
how to implement it?
any help is appreciated.
Thanks in advance.
For all the good things that Visual Studio does, it is not a good
general-purpose web-site development tool. for that, you need either
Dreamweaver (from Macromedia) or GoLive (from Adobe). Both support
templates exactly as you describe them. Both also support reusable
components (like user controls in ASP.NET); change the component,
and all pages that use them are updated.
I'm going to start exploring how to make this work in a practical
mode over the next few days as I start converting old Perl-based
forms in my site to ASP.NET. My first pass at solving the problem
will be to create an empty form in Visual Studio, using flow layout,
and save it. Then I'll open it in GoLive and build a template.
Then I'll create a new .aspx page from the template (in GoLive),
save it, and do the ASP.NET editing in Visual Studio.
One thing that's going to be interesting is that my site page
structure has a search field on every page. This requires a
form, independent from anything else in the page. ASP.NET
limits you to one form element per page, so for.aspx pages,
I'll have to add a button-click event handler for the search
button that will construct a URL from the search arguments
and do a Response.Redirect to the search engine. This event
handler will in effect become part of the "template" but since
it will live in the code-behind page for every .aspx page,
and needs to be part of the page subclass, handling that is
going to be a little tricky. Maybe I need to create a
subclass of system.web.ui.page, put the event handler there,
and have all my template-based.aspx pages subclass off my
page class.
Another thing that will require manual intervention is creating
the .cs and .resx files for each page created from the template.
I don't see a way to automate that yet.
We'll see..... I'm open to suggestions and ideas.
Diane
Diane