2012-08-03 39 views
0

我有一個ajaxpro方法的問題。在.cs文件中,我爲頁面定義了一些全局變量,如:Ajaxpro方法獲取全局頁面變量重新初始化?

public partial class Admin : System.Web.UI.Page 
{ 
    public int localidMember = 9; 
    protected void Page_Load(object sender, EventArgs e) 
    { 

     AjaxPro.Utility.RegisterTypeForAjax(typeof(Admin)); 


     if (HttpContext.Current.Session["HomeOwn_ID"] != null) 
     { 
      localidMember = Convert.ToInt32(HttpContext.Current.Session["HomeOwn_ID"].ToString()); 

     } 

    } 


    [AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)] 
    public string LoadInbox() 
    { 
     // I need to use the variable localidMember and expected that it will have the value that I have set to pageload.., but it didnt. The variable is reinitialized to 9... Anyone have any ideas what's going on... Thanks so much ! 
    } 

} 

回答

1

我認爲你不能這樣做;因爲在AjaxPro中,你無法處理控件屬性。