473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Template Web page

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

Nov 19 '05 #1
3 1160
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
Nov 19 '05 #2
The idea of a template is supported in ASP.NET 2.0 with Master Pages. If
this is a must have feature for you, I'd suggest not wasting your time with
a v1.x approach and move to v2.0.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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.


Nov 19 '05 #3
Hi Mds,

its possible in version 1.1 also, all you have do is read the article

http://www.codeproject.com/aspnet/Frame_Work_Design.asp

it will help you out.

Vijay Pote
MCP, MCAD, MCSD (In Dot Net)

"MDS" wrote:
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.

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: suzy | last post by:
hi, i have created a aspx page template by creating a template.cs file which inherits from the page class. In this file I override the OnInit event and create a template in the form of a...
3
by: Trapulo | last post by:
I've a datarepeater that loads custom external templates with loadtemplate and bind data to them. All ok. Now I need to localize some text labels, but I don't know how can I change this data. If I...
2
by: John Boers | last post by:
I am trying to create a template for my website. But I have a problem, the system says BC30469: Reference to a non-shared member requires an object reference and points to the statement...
4
by: Brian Barnes | last post by:
I am trying to create a template code behind file for a website which all pages should be inherited from. This base class however, when I try to view the aspx page in Visual studio .NET (2002), it...
2
by: Brent | last post by:
Like many sites, mine has a standard "look" -- a template, if you will -- that visitors see on each page. I've tried to keep the code and HTML separate to the extent possible, and for most standard...
3
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
0
by: Isz | last post by:
PROBLEM: This problem is related to the postback and handling events correctly. BACKGROUND: I have a datalist which acts as a tabbes list with horizontal layout. This datalist is bound to a...
6
by: Neal | last post by:
Hi All, I used an article on XSLT and XML and creating a TOC written on the MSDN CodeCorner. ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dncodecorn/html/corner042699.htm However, it did'nt...
2
by: rn5a | last post by:
Please have a look at the image at the URL given below: http://rn5a.brinkster.net/Template.gif I would like to use that image as a template for all the ASP pages in a website. Note that though...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.