I have a resource class [Resource1] which contains some string properties. Normally, those properties can be accessed by:
string myValue = Resource1.Value1;
Now, both the class name (Full) and property name is given (as string) at runtime. So can I please ask how can I update the code to make it work?
string myValue = "Resource1"."Value1";
I have had a look at the suggested duplication. If I used the codes below:
var type = Type.GetType("Full Name of Resource1");
var myObject = Activator.CreateInstance(type);
The second line will generated a "No parameterless constructor defined for this object." error.
The resource class is auto-generated by ASP.NET (It is defined via Resource1.resc under the Properties. I'm doing this in a MVC project).
Thanks in advance.
Sun