Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3402710
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:10:17+00:00 2026-05-18T05:10:17+00:00

I have an MVC2 web application that needs to record the number of unique

  • 0

I have an MVC2 web application that needs to record the number of unique logins by users. Each time a user logs in, there needs to be a record saved to a database. Just the basics like time, date and the like.

Given that the business requirements are to log only cases in one specific ActionResult (i.e. user logon), should I simply write some custom code to fire a record through to the database?

Alternatively, given the company does have a track record of later on changing their mind (uncommon as that is with clients), might I be better to create something a little more robust and use that?

Finally, what about using Log4Net instead? Given that the initial requirements only focus on one small part of one application, is that overkill even though it might be more extensible later?

Advice and lively debate appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:10:18+00:00Added an answer on May 18, 2026 at 5:10 am

    Since you are using the SqlMembershipProvider, the simplest thing to do might be to add an update trigger to the aspnet_Membership table. When LastLoginDate is updated, the trigger can populate a separate tracking table. You can do the same if you want to track failed login attempts using the FailedPasswordAttemptCount column.

    For more detail on how these fields are updated when the user logs in, see the documentation for the SqlMembershipProvider.ValidateUser method:

    When a user is successfully validated, the last activity date and last sign-in date values are updated to the current date and time in the database.

    If an incorrect password is supplied to the ValidateUser method, the internal counter that tracks invalid password attempts is incremented by one.

    With respect to logging in general, you may want to use a logging framework regardless, and I would suggest NLog.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net MVC2 application that needs to call a web service from
I have a Visual Studio 2010 MVC2 web application that I'm building via the
I have an asp.net mvc2 application that is using StructureMap 2.6 and NHibernate 3.x.
I have an asp.net mvc 2 web application that connects to a WCF web
I have a pretty big web application that I created last year using ASP.NET
I have an an MVC 2 web application that uses Master pages. In the
I have a web application which was using Asp.net MVC2 . I Upgraded it
I have created a new MVC2 project using the ASP.NET MVC2 Web Application, which
I have a .NET v4 application consisting of a web application (ASP.NET MVC2) and
I have an Asp.net MVC2 web application. I built the application using VS2008 and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.