List<object>
ASP.NET:セッションなどの複雑なオブジェクトを保持することは可能ですか? はいの場合、どうすればよいですか?セッションでリストを保持しようとしていますが、そのリストを文字列に変換できないと言われています。
編集
[Serializable]
public class Client
{
public string ClientType { get; set; }
public string ClientName { get; set; }
public string SubClientName { get; set; }
public string Project { get; set; }
public string Service { get; set; }
public string Activity { get; set; }
}
List<Client> ListOfClients;
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
ListOfClients = new List<Client> { new Client()};
Session["ListOfClients"] = ListOfClients;//This is where the error occurs
//Cannot convert List<Client> to string...
}
}
実行する操作は多数ありますが、アイデアは、セッション内のクライアントのリストにあるものをすべて保持することです。
助けてくれてありがとう。