public class AjaxMethodDemo
{
[AjaxPro.AjaxMethod]
public string getlanguage()
{
return "123456";
}
}
public partial class PageIndex : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxMethodDemo));
}
}
}
<script type="text/javascript">
function add() {
var str = 命名空间.AjaxMethodDemo.getlanguage();
alert(str.value);
}
</script>