asp.net - How to convert Object to List in c#? -



asp.net - How to convert Object to List<string> in c#? -

i have list<string> in model. when write html helper, can info metadata.model, object

// mvc3 (namespace system.web.mvc -> modelmetadata), did not write // summary: // gets value of model. // // returns: // value of model. more info system.web.mvc.modelmetadata, // see entry asp.net mvc 2 templates, part 2: modelmetadata on brad wilson's // blog public object model { get; set; }

my question is: how list<string> object?

if underlying type of object variable list<string>, simple cast do:

// throws exception if model not of type list<string> list<string> mymodel = (list<string>)model;

or

// homecoming null if model not of type list<string> list<string> mymodel = model list<string>;

c# asp.net list object

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -