开发者

Generating DropDownList from Globalization values in ASP.NET 4

开发者 https://www.devze.com 2023-03-04 22:38 出处:网络
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(\"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消