0

I have a procedure that has to be run once when a user logs into my asp.net website. The closest event that i could find is the LoggedIn event on my login control, however i cannot use this as it is not able to find the UserId of the currently logged in user yet.

So, what is the best way to run a procedure once after a user is authenticated?

Cinedine
  • 23
  • 2
  • 18

2 Answers2

0

Maybe try a page refresh after login then run a function on page load looking for "if userid=not null run stored procedure".

  • Good idea, but i cannot use this. My Procedure writes a new record to the database everytime. if i set userid=not null it will never run. – Cinedine May 01 '14 at 13:34
0

you can get the user yourself in onLoggedIn

MembershipUser user = Membership.GetUser(LoginControlName.UserName);
// then do stuff with the user.
gorrilla10101
  • 394
  • 1
  • 8