asp.net jquery ajax json: Simple example of exchanging data

后端 未结 2 646
失恋的感觉
失恋的感觉 2021-01-13 13:16

(Question resolved with the help of the two reply posts--see below)

I would appreciate help getting a simple example of exchanging data JSON data between a browser (

2条回答
  •  情书的邮戳
    2021-01-13 13:47

    I got this working right away. This is its most basic form:

    HTML:

    
    
        
    
        
        
    
    
        

    Code Behind:

    <%@ WebHandler Language="C#" Class="Handler" %>
    
    using System;
    using System.Web;
    
    public class Handler : IHttpHandler
    {
    
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write("Hello World");
        }
    
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
    

提交回复
热议问题