Generating DropDownList from Globalization values in ASP.NET 4
I have Global Resources file with four values that i need to assign to DropDownList on my page. Is there a way besides adding one by o开发者_Python百科ne, using DropDownList.Items.Add( new ListItem("")); ?
You could decide to simply generate the html.
Depending on the version of .NET you are using there are several ways to do this.
What is your reason not to add the items to the DropDownList?
It works and can be refactored to get your strings from other sources or a database if the need arises.
精彩评论