首页 > IT职业 > IT图书 > ExtJs的Ajax示例
ExtJs对äºAjaxç使ç¨é常ç®åï¼çä¸é¢ç代ç :
Â
1.Html页ï¼
html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                               Â                      Â
2.æå¡ç«¯GetData.ashx
using System.Web;
using System.Web.Services;
namespace Ajax_WCF
{
    ///Â
    /// codebehindclassname çæè¦è¯´æ
    ///Â
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class GetData : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (context.Request["name"] != null && context.Request["name"].ToString()!="")
            {
                context.Response.Write("Hello World," + context.Request["name"].ToString() + "!");
            }
            elseÂ
            {
                context.Response.Write("Hello World");
            }
        }
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3158/viewspace-2801048/ ,如需转载,请注明出处,否则将追究法律责任。