日期:2014-05-17  浏览次数:20416 次

jq中的ajax的返回值怎么接收啊?
<script type="text/javascript">
            $(document).ready(function () {
                $("#Llogin").click(function () {
                    $.ajax({
                        type: "post",
                        url: "../Ashx/login.ashx/Getjieguo",
                        datatype: "json",
                        contentType: "application/json; charset=utf-8",
                        success: function (data) {
                            alert(data);
                        }
                    });
                });
            });
        </script>

login.ashx页面:
[WebMethod]
    public static string Getjieguo()
    {
        return "实验!";
    }

为什么返回的结果永远是空呢?求指点!
ajax ASP.NET C#

------解决方案--------------------
using System;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Web.SessionState;
 
public class login : IHttpHandler, IRequiresSessionState
{
 
    public void ProcessRequest(HttpContext context)
    {
         
        string ss = "实验!";
        context.Response.Write(ss);
        context.Response.End();

    }
 
    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
    [WebMethod]
    public static string Ge