ITsolutionWizard
asked on
mvc, razor
Below is MVC project, and how can I pass the state list value into cshtml?
public ActionResult Index()
{
return View(StateList());
}
private List<string> StateList()
{
List<string> str = new List<string>();
XElement xelement = XElement.Load(fileBondList);
foreach (XElement xEle in xelement.Descendants("State"))
{
str.Add((string)xEle);
}
return str;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.