在我的页面上DropDownList
,我有一个用数据库值填充的SqlDataSource
(见下面的代码)。
如何在值之前添加自己的文本或空行?
<asp:DropDownList ID="drpClient" runat="server" Width="200px"
AutoPostBack="True" DataSourceID="dsClients" DataTextField="name"
DataValueField="client_id">
</asp:DropDownList>
<asp:SqlDataSource ID="dsClients" runat="server"
ConnectionString="my_connection_string"
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT [client_id], [name] FROM [clients]">
</asp:SqlDataSource>
谢谢。
PS您建议使用 aSqlDataSource
还是以另一种方式填充更好?