I have the following in the controller:
List <string> strResult = new List ();
And as will running the class will adding some information
strResult.Add ("The Text");
strResult.Add ("Text B");
strResult.Add ("Text C");
return View ("Index", ViewData ["result"] = new SelectList (strResult))
And the View
<textarea rows="10"> class="form-control"
@ViewData["resultImport"]
</ textarea>
But the only thing that appears is:
System.Web.Mvc.SelectList
in textarea
Why do you want to load a SelectList into a textarea? If you would like to return a "string list" you will need to convert your strResults variable from a List to a string in your Controller. Here is the code to do this:
string strReturnString = string.Join(",", strResult.ToArray());
ViewData ["result"] = strReturnString;
return View ("Index");
Then:
Use @ViewData["result"]
in your View