RadioButtonList绑定图片及泛型Dictionary应用
内容摘要
本博文是让你学会读取站点某一目录的图片,掌握LINQ与泛型Dictionary<TKey,TValue>的使用。
首先准备好几张图片存在站点某一目录之下,本例中的存储图片的目录名为MsSiteImage
首先准备好几张图片存在站点某一目录之下,本例中的存储图片的目录名为MsSiteImage
文章正文
本博文是让你学会读取站点某一目录的图片,掌握LINQ与泛型Dictionary<TKey,TValue>的使用。
首先准备好几张图片存在站点某一目录之下,本例中的存储图片的目录名为MsSiteImages,图片你可以从微软网站下载http://windows.microsoft.com/en-US/windows/home
我们写一个泛型数据集,将存储目录的图片信息:
首先准备好几张图片存在站点某一目录之下,本例中的存储图片的目录名为MsSiteImages,图片你可以从微软网站下载http://windows.microsoft.com/en-US/windows/home
我们写一个泛型数据集,将存储目录的图片信息:
下载 ,解压之后,把InsusListControlUtility.dll放入站点的BIN目录中。
private void Data_Binding()
{
Insus.NET.InsusListControlUtility objList = new Insus.NET.InsusListControlUtility();
objList.RadioButtonListParse(this.RadioButtonList1, GetData(), "value", "key");
}
在网页的Page_Load中,引用上面的Data_Binding()方法:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
Data_Binding();
}
运行网页的效果:
复制代码 代码如下:
private void Data_Binding()
{
Insus.NET.InsusListControlUtility objList = new Insus.NET.InsusListControlUtility();
objList.RadioButtonListParse(this.RadioButtonList1, GetData(), "value", "key");
}
在网页的Page_Load中,引用上面的Data_Binding()方法:
复制代码 代码如下:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
Data_Binding();
}
运行网页的效果:
代码注释