locked
Null Value in Linked Drop Down List RRS feed

  • Question

  • User-1890142112 posted

    I was wondering if there is any way that I could have a null value (or any other static value) appear at the top of a drop down list which is then populated from an AccessDataSource.


    I need it so that users can select a tag for their post (within a social networking system) if they wish to post to a group page or they can simply leave the list as null to post to their profile.


    Any help would be much appreciated.

    Sunday, April 25, 2010 6:59 AM

Answers

  • User-1509636757 posted

    You can set the AppendDataBoundItems property to "True" and add one static/blank item to dropdownlist like below:


        <div>
            <asp:DropDownList ID="ddlDropDown" runat="server" AppendDataBoundItems="true">
                <asp:ListItem Selected="True" Value="" Text="--Select--" />
            </asp:DropDownList>
        </div>



    hope it helps./.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 25, 2010 11:46 AM