我可以簡單地在aspx頁面中使用本地化,但不能在aspx.cs文件中使用。如何在靜態方法中使用LocalResourceObject [webmethod]
[WebMethod]
public static string Menu(int role, int driver)
{
string _permissions = dr["FN_2"].ToString().Replace(" /V*", System.Web.HttpContext.GetLocalResourceObject("CRL.aspx", "RV.Text").ToString());
// This way didn't get error in coding but when I run it, give me no permission error for virtual path
string _permissions = dr["FN_2"].ToString().Replace(" /V*", System.Web.HttpContext.GetLocalResourceObject("RV.Text").ToString());
//I cannot use in this way
}
在aspx頁面中,我可以這樣稱呼它GetLocalResourceObject("RV.Text")
。 我必須得到這些本地化的東西,我需要他們很多東西。
我不能以這兩種方式從localresource對象返回文本。其中一人在編碼時出錯,另一人由於許可無法到達虛擬路徑。我如何在[WebMethod]
中使用GetLocalResourceObject
?
你的問題是,它有點不清楚。 – 2014-09-12 11:45:03