asp.net服务器端的处理后,如何返回个客户端成功与否信息?
谢谢

解决方案 »

  1.   

    用ajax ,返回一个 js语句或JSON 
      

  2.   

    我采用的是formedit,服务器端处理程序,处理完毕后,客户端怎么获得处理的结果,并自动关闭form edit对话框?
           string Status = "success";
            context.Response.ContentType = "text/plain";
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;
            HttpSessionState session = context.Session;
            string oper = request.Form["oper"].ToString();
            string output = new JavaScriptSerializer().Serialize(Status);
            ....
            context.Response.Write("output");
           无论返回true还是 false 这样对话框还是不能自动关闭
           
      

  3.   

    closeAfterEdit:true,就会自动关闭添加afterSubmit事件获取服务器返回的信息
        afterSubmit : function(response, postdata) { … return [success,message,new_id] },参数说明和afterComplete一样
        此方法需要返回 [success, message, new_id] 格式的数据
        success :为boolean值,如果为true处理继续进行(message会被忽略),如果为false,将会弹出一个对话框显示错误信息(message的值)并停止其他处理
        message:错误信息
        new_id :在添加模式时可用于设置新数据行的id,所以添加时服务器需要同时返回保存到数据库的行ID
    参考:jqGrid表单编辑配置