forum

Home / DeveloperSection / Forums / If statement on dropDownList listItem

If statement on dropDownList listItem

Anonymous User 1972 20-Nov-2014

I need to add a condition to a DropDownList where a method can be executed by button click only if the user has selected a value different than the listItem (default value). 

<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True"
     DataSourceID="SqlDataSource5" DataTextField="proj_name" DataValueField="proj_name">
        <asp:ListItem Text="Select a project to clone" Value="" />
</asp:DropDownList>

How can I structure an if condition to validate that the selected value is not the ListItem (default value)?


Updated on 20-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By