如何通知用户有关错误的信息 [英] How to inform user about error

查看:80
本文介绍了如何通知用户有关错误的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

例如用户获取自动化失败。我想在View上告诉她。

在我的控制器上有方法:



Hello!
For example user get failed autorization. I want to inform her about it at View.
At my controller there is Method:

public bool Authorization(int IDNAGRAFICA = 0)
        {



}



如果bool = false我想生成消息并在View中返回。怎么做?



麻烦在于此:方法必须返回bool类型。但是和加载视图:


}

If bool = false i want to generate message and return it at View. How it make?

Trouble is at this: Method must return bool type. but and load View:

<pre lang="cs">ViewBag.messages = MESSAGES;
            return View();
            return false;</pre>

推荐答案

尝试

http://www.lazycoder.com/weblog/2009/03/18/aspnet-mvc-tip-return-specific-views-for-specific-errors/ [ ^ ]

如何处理ASP.NET MVC中的错误 [ ^ ]
Try
http://www.lazycoder.com/weblog/2009/03/18/aspnet-mvc-tip-return-specific-views-for-specific-errors/[^]
How to handle errors in ASP.NET MVC[^]


这篇关于如何通知用户有关错误的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆