I have an arraylist namelist in my model and in my view I need to fill the textarea with the values in the arraylist
{%>
<%=Html.TextArea("Namelist",Html.Encode(namelist))%>
<%}
But i`m having the following in my textarea being dislpayed:
System.Collections.ArrayList...
How to solve this?
Html.Encode takes a single String parameter. Passing it an ArrayList is causing the ToString method to be invoked which is returning the name of the object type.
You need to iterate the collection, building the String and then pass that to Html.Encode.
Edit with code sample