0
我有dropdownlist綁定到數據庫。我想添加數據庫中不存在的其他列表項。我能爲它做些什麼?數據時將默認值添加到asp.net中的dropdownlist
<asp:DropDownList ID="dpl_goalGallery" runat="server" CssClass="axmor-form-field selectType" AutoPostBack="True" Font-Size="14px" DataSourceID="ds_sourceGallery" DataTextField="galleryTitle" DataValueField="galleryId">
<asp:ListItem>select...</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="ds_goalGallery" runat="server" ConnectionString="<%$ ConnectionStrings:anaconnection %>" SelectCommand="sp_select_gallery" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter DefaultValue="0" Name="act" Type="Int32" />
<asp:Parameter DefaultValue=" " Name="fromDate" Type="String" />
<asp:Parameter DefaultValue=" " Name="toDate" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</asp:DropDownList>
謝謝!它非常有用。 –