CodeKeep C# Feed Agosto 29th, 2008
Description: criar elementos pra web config
Link:
http://www.codekeep.net/snippets/df1bfe1e-f23d-4659-ad06-e7757289142a.aspxusing System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
/// <summary>
/// Summary description for ItemMenuSettings
/// </summary>
public class ItemMenuSettings : ConfigurationElement
{
[ConfigurationProperty("title", DefaultValue = "", IsRequired = true)]
[StringValidator(InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 50)]
public string Title
{
get { return this["title"] as string; }
}
[ConfigurationProperty("description", DefaultValue = "", IsRequired = true)]
[StringValidator(InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 256)]
public string Description
{
get { return this["description"] as string; }
}
[ConfigurationProperty("url", DefaultValue = "", IsRequired = true)]
[StringValidator(InvalidCharacters = " ~!@#$%^&*()[]{};'\"|\\", MinLength = 1, MaxLength = 256)]
public string Url
{
get { return this["url"] as string; }
}
}
CodeKeep C# Feed Agosto 29th, 2008
Description: criar class para web config
Link:
http://www.codekeep.net/snippets/e9d636d8-4dbc-4709-a410-2aa036238b64.aspxusing System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
/// <summary>
/// Summary description for MenuConfigurationSection
/// </summary>
public class MenuSettings : ConfigurationSection
{
private static MenuSettings settings = ConfigurationManager.GetSection("MenuSettings") as MenuSettings;
public static MenuSettings Settings
{
get{ return settings; }
}
[ConfigurationProperty("key", DefaultValue = "", IsRequired = true)]
[StringValidator(InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 50)]
public string Key
{
get{ return this["key"] as string; }
}
[ConfigurationProperty("title", DefaultValue = "", IsRequired = true)]
[StringValidator(InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 50)]
public string Title
{
get{ return this["title"] as string;}
}
[ConfigurationProperty("description", DefaultValue = "", IsRequired = true)]
[StringValidator(InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 256)]
public string Description
{
get{ return this["description"] as string; }
}
[ConfigurationProperty("order", DefaultValue = 1, IsRequired = true)]
[IntegerValidator( MinValue = 1, MaxValue = 20)]
public int Order
{
get{ return (int)this["order"]; }
}
}
CodeKeep C# Feed Agosto 29th, 2008
Description: fegeg
Link:
http://www.codekeep.net/snippets/cdf9d537-5541-43b4-93f9-9116e5b1b731.aspxprotected void Page_Load(object sender, EventArgs e)
{
}