Hello,
I am trying to populate a dropdownlist with data pulled from a .resx file. Instead of having 5 different functions I'd like to be able to pass in the name of the .resx file and cast it somehow so I can retrieve it using GetReourceSet.
Here's what I'm currently doing:
protected void populateCountryPickList(DropDownList whatDropDownList)
{
ResourceSet rs = Resources.CountryPickList.ResourceManager.GetResourceSet(CultureInfo.CurrentCulture, true, true);
whatDropDownList.DataSource = rs;
whatDropDownList.DataTextField = "Value";
whatDropDownList.DataValueField = "Key";
whatDropDownList.DataBind();
}
In the example above I have a .resx file named CountryPickList.resx so its just a matter of using the .resx name to retrieve the ResourceSet using GetResourceSet...
What I would like to be able to do is figure out how I can pass in a string to my function with the name of the .resx and obtain the same results.
Any suggestions would be greatly appreciated!
cheers,
rise4peace