In the latest version of MVC and Identity there is no true best practice out on how to get the user and their ID yet. Therefore I have personally found adding a reference at the top of my controller allows me to get the UserId via the User.Identity class.
To get the currently logged in user ID.
Reason for this being a string is because in Identity 2 the Primary key is a GUID in a string.
string id = User.Identity.GetUserId();
Hope this helps someone.
Today we came across an issue where a user would get automatically logged out after 20 minutes of inactivity, even if it was trying to make a POST request, just the SQL statement lasted too long ( talk about needing refinement ). Therefore I though I would make a blog post as a reminder to myself on how to change this timeout.
1) Log into your dot net nuke instance as admin.
2) Navigate to Host>Host Settings>Other Settings.
3) Change the “Users Online Time” setting to your desired amount in minutes.
4) Save changes and relax.
Alright in my last post I pointed out how you could simply use Zoom.It by Live Labs inside of your windows phone 7 project. Where just a few moments ago @LocalJoost on twitter wrote a very good tutorial on his blog about using WP7’s multi-touch pan/zoom behaviors with the MSI control. You might want to check it out and apply it to your application for better results rather than using the touch controls I was playing with.
On the web almost no one goes by their real name anymore. This is because of privacy, when a person is online they can be anyone they want to be… Say you have a guy named “Bob” and he wants to criticize a blog post of one of his friends. In this situation, he can either tell his friend about his mistakes and risk his friend getting mad at him, or he can leave a comment on his blog via a different username, say “Elvis” perhaps.
Now I’m not saying it’s OK, or you should have a false username but in the situation “Bob” was in, it seemed acceptable. Usernames should be something unique, it should say something about you as a person.For example lets take apart my username “Ryanb58″
Ryan – My real middle name.
B – The first initial of my last name.
58 – A random number I just happen to like a lot at the point of creating my name.
See almost all of the parts of my username have to do with me. So maybe your name is “Eugine” and you want a cooler nick name for the web, in this case maybe don’t use your first name. Do you have a cooler maybe more elegant middle or last name? By all means use it if you do.
Usernames don’t even have to represent you if you don’t want. Say your a republican and your on a democratic website or forum. I’d personally name my self something that people wouldn’t know me as. Like Little-Larry or something. All is fair in the game of politics right?
Maybe you have a cool username or maybe a funny one. Let us know your username in the comments below and maybe explain how you gave yourself that name, don’t be afraid to post your username even if it has nothing to do with you!