Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

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;
        }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial