ITPub博客

首页 > IT职业 > IT图书 > ExtJs的Ajax示例

ExtJs的Ajax示例

IT图书 作者:yxl1108 时间:2021-09-09 09:14:38 0 删除 编辑
id="article_content">

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/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-30

  • 博文量
    82
  • 访问量
    492