Template based solution in asp.net

Discussion in 'ASP .Net' started by Abhishek Srivastava, Feb 16, 2004.

  1. 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.
     
    Abhishek Srivastava, Feb 16, 2004
    #1
    1. Advertising

  2. 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 <#>, abhishek-
    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/
     
    James Crowley, Feb 16, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Francis
    Replies:
    0
    Views:
    442
    Andrew Francis
    Jun 28, 2006
  2. =?Utf-8?B?Y2FzaGRlc2ttYWM=?=

    Solution file not in the solution folder

    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Sep 12, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,142
    Laurent Bugnion
    Sep 12, 2006
  3. , India
    Replies:
    17
    Views:
    1,121
    James Kanze
    Oct 1, 2007
  4. Replies:
    8
    Views:
    533
  5. Kursat
    Replies:
    1
    Views:
    334
    Dominick Baier
    May 7, 2007
Loading...

Share This Page