当采用datagrid自带的方法加载列表时,当在后台遇到错误时,如何在前台提示错误

 当采用datagrid自带的方法加载列表时,当在后台遇到错误时,不能通过

jsonResult.Data = new ExceuteResult(ExceuteResultType.Error, "参数错误!");

来返回错误,

因为datagrid有默认的返回格式,需要改成下面的对应格式,必须有total和rows

     jsonResult.Data = new

                {

                    total = 0,

                    errorMsg = "参数错误!",

                    rows = ""

                };

猜你喜欢

转载自www.cnblogs.com/hobby0524/p/8949396.html