Ich lade eine ASP.NET-Dropdown-Liste.Verwenden Sie Temp-Variable oder Inline in diesem Beispiel?
Gibt es einen Vorteil, dies zu tun ::
Private Sub LoadSeasonsListbox(ByVal seasons As List(Of Season))
Dim li As ListItem
For Each s As Season In seasons
li = New ListItem(s.SeasonDescription, s.SeasonCodeID)
frm.SeasonsList.Items.Add(li)
Next
End Sub
über diese:
Private Sub LoadSeasonsListbox(ByVal seasons As List(Of Season))
For Each s As Season In seasons
frm.SeasonsList.Items.Add(New ListItem(s.SeasonDescription, s.SeasonCodeID))
Next
End Sub
+1 Debugging ist ein guter Punkt. – AnthonyWJones