Joined June 2013
·

aditia rahman

Indonesia
·
·

I tried these both code

ViewBag.UserId = WebSecurity.CurrentUserId;

ViewBag.UserId = (int)WebSecurity.CurrentUserId;

but I got same error "You must call the "WebSecurity.InitializeDatabaseConnection" method before you call any other method of the "WebSecurity" class. This call should be placed in an _AppStart.cshtml file in the root of your site."

please help, thx


solve my self :

adding [InitializeSimpleMembership] on the top of controller name, and include Filter using MvcMovie.Filters;

Achievements
1 Karma
0 Total ProTip Views