浏览 1884 次
锁定老帖子 主题:各位,本人新来,请教一个问题!
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2007-05-04
Default.cs using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; namespace myajax { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //注册服务器端函数的类 AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default)); } [AjaxPro.AjaxMethod] public string GetMessage() { return "My name is goalbell !"; } } } Default.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="myajax._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>ajaxpro-action1</title> <script type="text/javascript"> myajax._Default.GetMessage(GetMessageOfTheDay_CallBack); function GetMessageOfTheDay_CallBack(response) { alert(response.value); } </script> </head> <body> <form id="form1" runat="server"> <div> <input id="GetMessage" type="button" value="按钮" onclick="GetMessageOfTheDay_CallBack();" /> </div> </form> </body> </html> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |