如何在RadioButtonlist绑定数据库中的图片后设置默认选择第一项
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Horizontal" DataSourceID="SqlDataSource1"
DataTextField="test1" DataValueField="id"
ondatabound="RadioButtonList1_DataBound">
</asp:RadioButtonList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:sqlTestConnectionString %>"
SelectCommand="select id,'<img src=/1/'+url+'>' as test1 from Table_3"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
protected void Page_Load(object sender, EventArgs e)
{
//RadioButtonList1.DataSource = TM.DBUtility.DbHelperSQL.GetDataTable("select id,'<img src=/1/'+url+'>' as test1 from Table_3");
//RadioButtonList1.DataTextField = "test1";
//RadioButtonList1.DataValueField = "id";
//RadioButtonList1.DataBind();
}
protected void RadioButtonList1_DataBound(object sender, EventArgs e)
{
RadioButtonList1.Items[0].Selected = true;
}