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

关于ajax调用一般处理文件,传值内容过多后无法进入一般处理文件的问题
 // 请求数据
    $.ajax("/Handler/BackstageHandler/News_Handler.ashx",
    {
        async: false,
        data: {
            Action: "Insert",
            title: title,
            Code: Code,
            origin: origin,
            url: url,
            ptime:ptime,
            content: content
        },
        success: function (data, textStatus) {
            $.pnotify({ pnotify_text: data });
        },
        error: function (data, textStatus) {
            $.pnotify({
                pnotify_type: "error",
                pnotify_text: data.responseText
            });
        }
    });
}

这是JS中的内容其中有一个 content值是从kindeditor插件里获取内容。  
var content = editor.html().replace(/</g, "&lt").replace(/>/g, "&gt") || " ";
到调用到这里的时候我如果content的值很小那么会调用到后台的一般处理文件,调试模式能进入。
但是content变量里的值长度我看了下是15000多就无法进入一般处理文件。请问这是什么情况。


下面是一般处理文件里头部的代码:
  /// <summary>
    /// News_Handler 的摘要说明
    /// </summary>
    public class News_Handler : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            // 在完全处理之后再发送到请求客户端
            context.Response.BufferOutput = true;
            // 在服务器端不缓存页
            context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
            // 设置任何代理服务器不缓存页
            context.Response.AddHeader("pragma", "no-cache");
            // 设置请求的客户端浏览器不缓存页
            context.Response.AddHeader("cache-control", "");
 &