我的asp.net C#项目中有一个名为"admin"的类.
它是:
public class Admin { private int ID; private string FirstName, LastName, IsMainAdmin, Email, Username, Password,BirthDate, EntryDate; public int id { get { return ID; } set { ID = value; } } public string firstname { get { return FirstName; } set { FirstName = value; } } public string lastname { get { return LastName; } set { LastName = value; } } . . .
登录后会创建一个会话,如下所示:
Admin admin = isAdmin(username, password); if (admin != null) { **Session.Add("maskanAdmin", admin);** Response.Redirect("panel.aspx"); }
在其他页面中,我需要通过jquery ajax在页面请求之后的代码后面的会话中获取管理员的ID.
请注意,我在Method后面的代码是[WebMethod],它不支持Session Object.
我能得到它吗?怎么样?