Preferred Language:
Listing 28.18 - App_Code\DesignSection.cs
using System;
using System.Configuration;
using System.Drawing;
namespace AspNetUnleashed
{
public class DesignSection : ConfigurationSection
{
[ConfigurationProperty("backcolor", DefaultValue = "lightblue", IsRequired = true)]
public Color BackColor
{
get { return (Color)this["backcolor"]; }
set { this["backcolor"] = value; }
}
[ConfigurationProperty("styleSheetUrl", DefaultValue = "~/styles/style.css", IsRequired = true)]
[RegexStringValidator(".css$")]
public string StyleSheetUrl
{
get { return (string)this["styleSheetUrl"]; }
set { this["styleSheetUrl"] = value; }
}
public DesignSection(Color backcolor, string styleSheetUrl)
{
this.BackColor = backcolor;
this.StyleSheetUrl = styleSheetUrl;
}
public DesignSection()
{
}
}
}
Need ASP.NET and Visual Studio 2008 Training?
- Learn ASP.NET 3.5 from Stephen Walther, author of ASP.NET 3.5 Unleashed.
We've provided ASP.NET training for NASA, Lockheed Martin, the National Science Foundation, Verizon,
Boeing, the US House of Representatives, Kaiser, Petco, Mary Kay, and Microsoft.
Why not your company?
-
Receive a four day, hands-on, intensive workshop.
-
We fly to you, anywhere in the world.
-
We can bring our own laptops.
To learn more, visit the
Superexpert Training website.