1、访问不存在的页面和接口,Response响应自定义提示信息
2、在.net framework中,可以统一在Global全局文件的错误方法里设置,代码如下
if ((new HttpRequestWrapper(Request)).IsAjaxRequest())
{
Response.ContentType = "application/json";
Response.Write("{\"c\":\"199\",\"m\":\"接口方法出错\"}");
}
else
{
string html = string.Format(@"<div style={0}>{1}</div>", "\"height:50px;width:100%;text-align:center;\"", "系统繁忙,请稍后");
Response.ContentType = "test/html";
Response.Write(html);
}
Response.Flush();
Server.ClearError();