Templates in ASP.NET

Results 1 to 2 of 2

Thread: Templates in ASP.NET

  1. #1
    Join Date
    Dec 1969

    Default Templates in ASP.NET

    Can I create page templates like I did in ASP? I want to create a template that has my standard header, footer and menu and then use that for all my pages. If I can, how?<BR>

  2. #2

    Default RE: Templates in ASP.NET

    And how did you create them in asp? ;)<BR><BR>This is an ongoing issue for ASP.Net.<BR>My cow-worker is absolutely convinced of his way of doing it in the code-behind using a base class for everything in the project. He adds some controls then moves all the controls that were on the page into the added controls.<BR><BR>While there is a lot to said for doing it in a base class, I don&#039;t feel that it accomplishes a good separation of design and content. (compiled design)<BR><BR>One could also use the CreateChildControls() method (check the C# forum) to do this kind of thing.<BR><BR>Annother common approach is to use ascx files, breaking up the layout into chunks and draging those chunks onto the designer, much like include files were used in asp. NOTE : this allows you to put functionality into the chunks, it may be ugly at design time, but it works.<BR><BR>I&#039;m working on a group of controls for this problem, with a paired templateSource and a templateOutputContainer on each page. Both controls maintain ALL design time functionality in VS.Net, I should have a beta ready soon, but I plan to sell this control set, not distribute the soucre, I spent a lot!! of time figuring it out.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts