AjAX常用的公共返回类型

用于AjAX回传

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HPIT.RentHouse.Common
{
    public enum ResultState
    {
        Error = -1,
        Success = 1
    }

    public class AjaxResult
    {
        public ResultState State { get; set; }
        public string ErrorMessage { get; set; }

        public object Data { get; set; }

        public AjaxResult(ResultState state, string errorMessage)
        {
            this.State = state;
            this.ErrorMessage = errorMessage;
        }
        public AjaxResult(ResultState state, string errorMessage,object data)
        {
            this.State = state;
            this.ErrorMessage = errorMessage;
            this.Data = data;
        }
    }
}

 

AjAX常用的公共返回类型

上一篇:[php]配置文件中的超时时间


下一篇:js 判断数据类型,以及undefined和null的理解