In my controller I installed
ViewData.Model = DBModel.Table.Take(1).Single();
Where DBModel is created by DBML Linq-to-SQL file
And I can access the value of thro ' ViewData.Eval("ColumnName"),
But if I create my own class
Class Test{
public string Col = "Testing ViewData";
}
Test objTest = new Test();
ViewData.Model = objTest;
Now, if I try to get ViewData.Eval("Col"), returns null.
Both tried to save in ViewData.Model.
What is the problem.
source
share