using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MySql.Data.MySqlClient;
using MySql.Data;
using System.Web.Security;
using System.Data;
using System.IO;
using SurelyKnown.Core;
using System.Configuration;
using System.Collections;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Xml;
using System.Windows.Forms;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[System.Web.Services.WebMethod(EnableSession = true)]
public static string[] GetCompletionList(string prefixText, int count, string contextKey)
{
int newOrgID = Convert.ToInt32(Session["uOrgID"].ToString());
的錯誤是最後一行獲取方法
CS0120: An object reference is required for the non-static field, method, or property 'System.Web.UI.Page.Session.get'
我應該怎麼做才能在方法內部會話值內Session變量。
可能的重複http://stackoverflow.com/questions/5586564/asp-net-access-session-from-static-method-static-cl屁股 – christofr 2011-10-17 12:34:49