Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have returned a list of classes List<warning> from the control class like this:
public ActionResult Ex3()
       {
           List<warning> warningsList = new List<warning>();

           XElement xelem = XElement.Load(transformedFile);
           var warnings = from elem in xelem.Descendants("warning")
                          select elem;

           foreach (var v in warnings)
           {
               warning warn = new warning();
               warn.id = v.Attribute("id").Value;

               warningsList.Add(warn);

           }
           return View(warningsList);
       }


i have created a view with the option "create a strongly typed view" and i have choose the warning class as a model.
Now, in Ex3View.cshtml, i want to create and fill a gridpannel with the values in the warningsList. Please note that the view file is .cshtml and not .aspx.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900