以下は私のコードです
List<test> Students = new List<test>(){
new test() { name = "Jack", imgpath = "15", Des = "100" },
new test() { name = "Smith", imgpath = "15", Des = "101" },
new test() { name = "Smit", imgpath = "1", Des = "102" }
};
GridView1.DataSource = Students;
GridView1.DataBind();
私のクラスは次のとおりです。
public class test
{
public string name;
public string imgpath;
public string Des;
}
しかし、「'name' という名前のフィールドまたはプロパティが、選択したデータ ソースに見つかりませんでした」というエラーが表示されます。
では、それを解決する方法。私のコードで何が間違っているのかわかりません。
ありがとう