Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?..
Posted

1 solution

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[^]
 
Share this answer
 
Comments
Magesh M N 27-May-15 5:40am    
May i know when User.Identity is saved, in my case it return blank always, what to do for get username in user.identity
Andy Lanng 27-May-15 6:04am    
You will have to use something called Form Authentication. There is a great write up here A Beginner's Tutorial on Custom Forms Authentication in ASP.NET MVC Application

I use a custom one myself. It's really easy to set up and there are loads of articles on it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900