C# httpc中的会话等价物#
下面是在控制器中用JAVA编写的代码。我将cart对象保存在HttpSession中,这样我就可以在同一个会话中检索它。在C#中有没有类似的方法 使用属性 要保存:C# httpc中的会话等价物#,c#,java,asp.net,session-state,httpsession,C#,Java,Asp.net,Session State,Httpsession,下面是在控制器中用JAVA编写的代码。我将cart对象保存在HttpSession中,这样我就可以在同一个会话中检索它。在C#中有没有类似的方法 使用属性 要保存: Session["cart"] = cart; 要检索: Cart cart = Session["cart"] as Cart; if(cart != null) { //found } 请参阅:使用属性 要保存: Session["cart"] = cart; 要检索: Cart cart = Session["ca
Session["cart"] = cart;
要检索:
Cart cart = Session["cart"] as Cart;
if(cart != null)
{
//found
}
请参阅:使用属性
要保存:
Session["cart"] = cart;
要检索:
Cart cart = Session["cart"] as Cart;
if(cart != null)
{
//found
}
见: