Elmah_Error表中的用户字段为空 [英] User field empty in Elmah_Error Table

查看:89
本文介绍了Elmah_Error表中的用户字段为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



在我的mvc项目中使用Elmah进行错误记录,它工作正常,

但是用户列在Elmah_Error表保持空白...

为什么会发生..



我想在此字段中保存当前登录用户ID,

我该怎么做?..

Hi All,

In My mvc Project am using Elmah for Error Logging , It works fine,
But the User column in Elmah_Error table remains blank...
why it happens..

I wants to save the current login userid in this field,
how can i do this?..

推荐答案

你是如何处理登录的?



使用表单身份验证时, User.Identity 将被填充。这是用户列中使用的内容。如果您自己处理用户身份验证,那么它将保持为空。



查看asp论坛以查找类似问题:





http://forums.asp.net/t/1215784.aspx [ ^ ]
How are you handling the logins?

With form authentication, the User.Identity is filled. This is what is used in the User column. If you handle the user authentication yourself then it will remain empty.

Check out the asp forums for a similar issue:


http://forums.asp.net/t/1215784.aspx[^]


这篇关于Elmah_Error表中的用户字段为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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