我的问题是我有两列video_url和image_src 我想在单个datalist中同时绑定这个aspx代码
<asp:DataList ID="DataList2" runat="server">
<ItemTemplate>
<li>
<script type="text/javascript">
function dd() {
var s = '<%#Eval("Video_url")%>';
if (s == "") {
"<a href='Client_website/raymond_shop.aspx'><img style='width: 245px; height: 220px;' src=Ads_image/" + <%#Eval("Image")%> +"/></a>";
}
else {
" <iframe frameborder='0' allowfullscreen='' src='" +<%#("Video_url")%> +"' style='width: 245px; height: 180px;' id='Iframe2'></iframe>";
}
}
</script>
<%-- <iframe frameborder="0" allowfullscreen="" src="//www.youtube.com/embed/icr2X5aKRMU" style="width: 245px; height: 180px;" id="Iframe2"></iframe>--%>
</li>
</ItemTemplate>
</asp:DataList>
C#代码
public void fi()
{
ds = cat.fill("tbl_Main_ads where status=1");
DataList2.DataSource = ds;
DataList2.DataBind();
}