How to add a default “Select” option to this ASP.NET DropDownList control?

后端 未结 7 2128
别那么骄傲
别那么骄傲 2021-01-02 05:06

I am a new ASP.NET developer and I am trying to learn Linq-To-Entities. I am trying to bind a DropDownList with the Linq statement for retrieving the list of status in the S

7条回答
  •  耶瑟儿~
    2021-01-02 05:23

    Private Sub YourWebPage_PreRenderComplete(sender As Object, e As EventArgs) Handles Me.PreRenderComplete
    
         If Not IsPostBack Then
         DropDownList1.Items.Insert(0, "Select")
         End If
    
    End Sub
    

提交回复
热议问题