473,386 Members | 1,801 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,386 software developers and data experts.

Template based solution in asp.net

Hello All,

In almost all websites which I have developed, we need to follow a
layout template (header, footer, menu on left hand side etc)

In ASP.NET solutions, we can do this in two ways

1) use user controls.

But frankly, making a "control" which renders a table of width 100% with
a gif somehow to me it seems wrong. I would create a control to
encapsulate a particular piece of functionality or component. Not really
to control the page layout.

Secondly if I am changing the layout tomorrow (maybe I found a better
javascript tree library) then I have to rebuild recompile the user control.

2) Use a common base class for Code behind classes.

This is also good. but then the layout gets tied up with C# code. and
therefore, layout change would mean getting a C# programmer first.

Is there some better way of implementing templates or site look and
feel. Why not specify the layout of a page in an XML format. and then
the asp.engine doing its rendering only into a specific portion as
specified in the XML. So that If I find a better tree control I just
change the xml file so that the new javascript tree menu gets included.

regards,
Abhishek.
Nov 18 '05 #1
1 1214
You may find it worthwhile to check out how the templates are
implemented in the ASP.NET forums (http://www.asp.net/).

Regarding the user controls - if you have a header and a footer user
control, you wouldn't have to necessarily render a table of width 100% -
just literally render whatever HTML you'd want appearing on each page.
And if you don't use CodeBehind (which you probably won't need in the
UserControl anyway - because its just acting as a template), then you
won't need to recompile - you'll just have to upload the modified
UserControl.

In article <#1**************@TK2MSFTNGP09.phx.gbl>, abhishek-
sr********@nospam.net says...
Hello All,

In almost all websites which I have developed, we need to follow a
layout template (header, footer, menu on left hand side etc)

In ASP.NET solutions, we can do this in two ways

1) use user controls.

But frankly, making a "control" which renders a table of width 100% with
a gif somehow to me it seems wrong. I would create a control to
encapsulate a particular piece of functionality or component. Not really
to control the page layout.

Secondly if I am changing the layout tomorrow (maybe I found a better
javascript tree library) then I have to rebuild recompile the user control.

2) Use a common base class for Code behind classes.

This is also good. but then the layout gets tied up with C# code. and
therefore, layout change would mean getting a C# programmer first.

Is there some better way of implementing templates or site look and
feel. Why not specify the layout of a page in an XML format. and then
the asp.engine doing its rendering only into a specific portion as
specified in the XML. So that If I find a better tree control I just
change the xml file so that the new javascript tree menu gets included.

regards,
Abhishek.


--
~ James Crowley
http://www.developerfusion.com/
Nov 18 '05 #2

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

Similar topics

1
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that deal with templates. Exercise 13.9 asks for me...
0
by: Chris F Clark | last post by:
In our C++ project we have some internal bug reporting macros that we use to get useful information when the program does something unexpected. Essentially at the point of the error, we invoke an...
4
by: wkaras | last post by:
I would like to propose the following changes to the C++ Standard, the goal of which are to provide an improved ability to specify the constraints on type parameters to templates. Let me say from...
3
by: danilo.horta | last post by:
Hi guys I'm trying to accomplish a slightly difficult task. I think it's more easy to explain trought an unworking code: template<class T, size_t numDim> VecBasis {/*...*/}; typedef...
2
by: Imre | last post by:
Hi I'm trying to write a function template called CallF(), that has a type argument called T. It has one argument, a T*. If T has a member function F(), then CallF() should call it, otherwise it...
2
by: pookiebearbottom | last post by:
Just trying to learn some things about templates. Was wondering how boost::tupple really works, but the headers were a bit confusing to me. I know you get do something like the following, just...
12
by: stefan.bruckner | last post by:
Hi, I am looking for a way to achieve the following. I've tried a couple of things, but they all ended up being too complicated: I have a templated class A. I want another class B to be able...
7
by: aaragon | last post by:
Hi everyone, The idea is quite simple: generate a container with random values in it. For that, I decided to create a class that I called RandomContainer that inherits from a container (with...
1
by: WebCM | last post by:
I'm looking for a good idea or ready library for templates. HTML with PHP isn't the best solution (it's more difficult for end-users of CMS to edit them). Perhaps, everything I need is: -...
13
by: Peter | last post by:
VS2008 ans ASP.NET 3.5, Office 2003 What is the best way to run Excel Template from ASP.NET web page were the Excel is only installed on the client without any ActiveX? If so can someone point...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.