J
jen_designs
I am trying to create a template in dot net. All the articles I have
read on the net are rather confusing. I need a simple solution to
create a header and a footer on each page. Can someone point me into
the right direction.
I started off creating a file template.cs:
using System;
using System.Web;
using System.Web.UI;
protected override void OnInit(EvantArgs args)
{
this.Controls.AddAt(0, LoadControl("header.ascx"));
base.OnInit(e);
this.Controls.Add(LoadControl("footer.ascx"));
}
then in the aspx page I did the following:
<%@ Page Language="C#" ContentType="text/html"
ResponseEncoding="iso-8859-1" Codebehind="template.cs" %>
This is the main content
does the template.cs need to be compiled?
Any thoughts?
read on the net are rather confusing. I need a simple solution to
create a header and a footer on each page. Can someone point me into
the right direction.
I started off creating a file template.cs:
using System;
using System.Web;
using System.Web.UI;
protected override void OnInit(EvantArgs args)
{
this.Controls.AddAt(0, LoadControl("header.ascx"));
base.OnInit(e);
this.Controls.Add(LoadControl("footer.ascx"));
}
then in the aspx page I did the following:
<%@ Page Language="C#" ContentType="text/html"
ResponseEncoding="iso-8859-1" Codebehind="template.cs" %>
This is the main content
does the template.cs need to be compiled?
Any thoughts?