【发布时间】:2011-08-23 21:14:22
【问题描述】:
我有一个绑定到数据表的 RadioButtonList。在数据表中,有一列是图片的 url,另一列是描述。
以下是我现在正在做的事情(虽然没有工作):
foreach ( acryliccolor scurrent in ssmacryliccolor )
{
DataRow dr = dt.NewRow();
dr["TEXT"] = "<img src=\"\\colorswatches\\" + scurrent.SwatchURL + "\" alt=\"\" border=\"0\" /><span style=\"margin-right:21px;\"></span>" + scurrent.Color;
dr["VALUE"] = "ID|SC_" + scurrent.ID.ToString() + ";CSID|" + current.ID.ToString() + ";JS|radiosimple(this)";
dt.Rows.Add(dr);
}
this.rblAcrylicColors.DataSource = dt;
this.rblAcrylicColors.DataTextField = "TEXT";
this.rblAcrylicColors.DataValueField = "VALUE";
this.rblAcrylicColors.DataBind();
如何在每个单选按钮项的说明旁边添加图片?
【问题讨论】:
标签: asp.net image data-binding radiobuttonlist