Create Website and add Default.aspx page and in it add lable (lblCopyright)
and in Default.aspx.cs
public string DynamicCopyright(string YearSiteCreated)
{
string DynamicCopyrightYear;
//Is the current year equal to the year the site was created?
if (DateTime.Now.Year.ToString() != YearSiteCreated)
{
//If not then concatenate year created and current year
DynamicCopyrightYear = YearSiteCreated + "-" + DateTime.Now.Year.ToString();
}
else
{
DynamicCopyrightYear = YearSiteCreated;
}
string Copyright = "Copyright © " + DynamicCopyrightYear + ". All rights reserved.";
return Copyright;
}
protected void Page_Load(object sender, System.EventArgs e)
{
lblCopyright.Text = DynamicCopyright(2006);
//Use the created year as parameter
}
Sunday, May 11, 2008
Subscribe to:
Post Comments (Atom)


No comments:
Post a Comment