[Asp.Net]4種方法把資料繫結到Dropdownlist
阿新 • • 發佈:2019-01-03
public class ClassMonth
{
private string _MonthEN = DateTime.Now.ToString("MMMM",System.Globalization.CultureInfo.CreateSpecificCulture("en"));
private string _MonthCN = DateTime.Now.ToString("MMMM", System.Globalization.CultureInfo.CreateSpecificCulture("zh-CN"));
public ClassMonth()
{
MonthCN = DateTime.Now.ToString("MMMM", System.Globalization.CultureInfo.CreateSpecificCulture("zh-CN"));
MonthEN = DateTime.Now.ToString("MMMM", System.Globalization.CultureInfo.CreateSpecificCulture("en"));
}
public ClassMonth(string cn,string en)
{
MonthCN = cn;//匯入變數為屬性賦值
MonthEN = en;//匯入變數為屬性賦值
}
public string MonthEN //構造屬性
{
get
{
return _MonthEN;
}
set
{
_MonthEN = value;
}
}
public string MonthCN //構造屬性
{
get
{
return _MonthCN;
}
set
{
_MonthCN = value;
}
}
}
{
private string _MonthEN = DateTime.Now.ToString("MMMM",System.Globalization.CultureInfo.CreateSpecificCulture("en"));
private string _MonthCN = DateTime.Now.ToString("MMMM", System.Globalization.CultureInfo.CreateSpecificCulture("zh-CN"));
public ClassMonth()
{
MonthCN = DateTime.Now.ToString("MMMM", System.Globalization.CultureInfo.CreateSpecificCulture("zh-CN"));
MonthEN = DateTime.Now.ToString("MMMM", System.Globalization.CultureInfo.CreateSpecificCulture("en"));
}
public ClassMonth(string cn,string en)
{
MonthCN = cn;//匯入變數為屬性賦值
MonthEN = en;//匯入變數為屬性賦值
}
public string MonthEN //構造屬性
{
get
{
return _MonthEN;
}
set
{
_MonthEN = value;
}
}
public string MonthCN //構造屬性
{
get
{
return _MonthCN;
}
set
{
_MonthCN = value;
}
}
}