drop down list value in asp.net

前端 未结 9 2059
刺人心
刺人心 2021-01-18 08:29

I want to add a value to the drop down list that cannot be selected, like a title. Ex: I have a month drop down list. The very first item should be \"select month\" this sho

9条回答
  •  既然无缘
    2021-01-18 08:49

    VB Code:

    Dim ListItem1 As New ListItem()
    ListItem1.Text = "put anything here"
    ListItem1.Value = "0"
    drpTag.DataBind()
    drpTag.Items.Insert(0, ListItem1)
    

    View:

    
    
    

提交回复
热议问题