ページのバックエンドにあるプロパティを使用してCookieを設定しようとしていますが、奇妙な結果が出ています。クッキーを使用する正しい方法です。ASP.Net(c#)でプロパティとしてCookieを使用する方法
とにかくこれを処理する方法や、既に済んでいる例について、あなたが考えているなら、私は応答に感謝します。 ありがとう。
int CurrentID
{
get
{
if (Request.Cookies["CurrentID"] == null)
Response.Cookies.Add(new HttpCookie("CurrentID", "0"));
return Request.Cookies["CurrentID"].Value.AsID();
}
set
{
if (Request.Cookies["CurrentID"] != null)
Response.Cookies.Remove("CurrentID");
Response.Cookies.Add(new HttpCookie("CurrentID", value.ToString()));
}
}
どのような「奇妙な結果」ですか? – scottm