我后面的aspx文件的文件中的代码看起来像这样的时候:访问页面的方法访问页面与页面方法
public partial class Pages_MyPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
.....
}
protected int MyMethod()
{
.....
}
[WebMethod]
public static int MyPageMethod()
{
int x = MyMethod();
return x;
}
}
当我送一个AJAX POST到MyPageMethod,我可以”访问MyMethod。解决这个问题的方法是什么。
感谢您的建议。
好,非常感谢,这使得它很容易。 – frenchie 2011-06-16 20:35:13