Copyright Notice Component
Set this component in your Masterpage, and forget it! Automatically keeps your
ASP.NET website
copyright string up-to-date as the year changes on your server. In the format approved
by the
US Government Copyright Office
, of course. C# source code.
Easy to set up, Easy to use
-
Copy the
CopyrightNotice.cs
C# source code into your /App_Code folder.
-
Insert an
asp:label
component where you want your Copyright notice to appear. Like this:
<asp:label id="copyrightLabel" runat="server"></asp:label>
-
Use the component. Usually, you would do this in your MasterPage.master.cs
file, like this:
protected void Page_Load(object sender, EventArgs e)
{
if ( !IsPostBack ) {
string originalYear = "1999";
string companyName = "Acme Skateboards";
copyrightLabel.Text =
new CopyrightNotice( companyName, originalYear ).ToString();
}
}
Note that the id of the label in your Master page (copyrightLabel)
is the name of the label in your code-behind file.
Comments
We use this component in our own Master file. It appears at the bottom of all our
pages.
Why not just build the data into the component? You can do this, but passing the
company name and original year as parameters, you can re-use the component on any number
of sites.
Terms
You are licensed to use this component in as many websites as you wish, but you
may not sell it, or bundle it with other components for resale.
Shipping Content
Delivered by email as a ZIP file:
Buy now!
|