My DropDownList control is getting the information from an ObjectDataSource. I need the initial item showing on the DropDownList to be "Select an item" which is not in the database. How do I do this?
See my code below. Thanks.
<aspropDownList ID="ddlCP" runat="server"
DataSourceID="odsCP"
DataTextField="Project Name"
DataValueField="Project Name"
AutoPostBack="True"
OnSelectedIndexChanged="ddlCP_SelectedIndexChanged" >
<asp:ListItem Selected="True" Text=" Select an item..." Value=" Select an item..."></asp:ListItem>
</aspropDownList>
<asp:ObjectDataSource ID="odsCP" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetUserCP"
TypeName="IRISTableAdapters.vwUserCPTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="txtCreator" Name="username" PropertyName="Text"
Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
See my code below. Thanks.
<aspropDownList ID="ddlCP" runat="server"
DataSourceID="odsCP"
DataTextField="Project Name"
DataValueField="Project Name"
AutoPostBack="True"
OnSelectedIndexChanged="ddlCP_SelectedIndexChanged" >
<asp:ListItem Selected="True" Text=" Select an item..." Value=" Select an item..."></asp:ListItem>
</aspropDownList>
<asp:ObjectDataSource ID="odsCP" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetUserCP"
TypeName="IRISTableAdapters.vwUserCPTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="txtCreator" Name="username" PropertyName="Text"
Type="String" />
</SelectParameters>
</asp:ObjectDataSource>