有没有办法将objectdatasource绑定到带有runat = server属性的html select标记。
<select size="1" id='standard' onchange="toggleOption(this)" name='standard' class='custom-select' >
答案 0 :(得分:1)
试试这个
就像asp下拉列表框一样
<select size="1" id="standard" runat="server" onchange="toggleOption(this)" name='standard' class='custom-select' >
C#代码
standard.DataTextField = "title";
standard.DataValueField = "val";
standard.DataSource = SrCity;
standard.DataBind();