Let me guess... your model is null.
The problem is that while you are populating the
m
object, it is never being added to the
mlist
object model which is being returned.
In the first couple of lines in the controller, you create 2 object instances
List<menu> mlist = new List<menu>();
Menu m = new Menu();
And then you populate the
m
object by iterating through the SQL recordset
while (myReader.Read())
{
m.LinkText = (string)myReader["TextLinkName"];
m.Actionname = (string)myReader["ActionLinkName"];
m.controllername = (string)myReader["routevalue"];
}
And finally you return your view
return View(mlist);
Looks like the last line in your
Reader.Read() loop should be something like
mlist.Add(m)