Home
Manage Your Code
Snippet: criar elementos pra web config (C#)
Title: criar elementos pra web config Language: C#
Description: criar elementos pra web config Views: 171
Author: Rui Santos Date Added: 8/29/2008
Copy Code  
1using System;
2using System.Data;
3using System.Configuration;
4using System.Linq;
5using System.Web;
6using System.Web.Security;
7using System.Web.UI;
8using System.Web.UI.HtmlControls;
9using System.Web.UI.WebControls;
10
11
12/// <summary>
13/// Summary description for ItemMenuSettings
14/// </summary>
15public class ItemMenuSettings : ConfigurationElement
16{
17    [ConfigurationProperty("title", DefaultValue = "", IsRequired = true)]
18    [StringValidator(InvalidCharacters = "  ~!@#$%^&*()[]{}/;’\"|\\", MinLength = 1, MaxLength = 50)]
19    public string Title
20    {
21        get { return this["title"] as string; }
22    }
23
24    [ConfigurationProperty("description", DefaultValue = "", IsRequired = true)]
25    [StringValidator(InvalidCharacters = "  ~!@#$%^&*()[]{}/;’\"|\\", MinLength = 1, MaxLength = 256)]
26    public string Description
27    {
28        get { return this["description"] as string; }
29    }
30
31    [ConfigurationProperty("url", DefaultValue = "", IsRequired = true)]
32    [StringValidator(InvalidCharacters = "  ~!@#$%^&*()[]{};’\"|\\", MinLength = 1, MaxLength = 256)]
33    public string Url
34    {
35        get { return this["url"] as string; }
36    }
37}
38