MVC C# SQL Membership Provider How to get User Name of Logged in User

Finding the User Name of the currency logged on user or any user is very simple.

You can use System.Web.Security.Membership namespace.

To find the user name of the current logged in user.

var username = User.Identity.Name;

Further more you can get all membership details of any registered member by

var username = User.Identity.Name;
var membershipUser = Membership.GetUser(username);// pass in the username of the user whose membership details you want to access.

Now to access the Guid of the user you can do this.

if (membershipUser != null){
var userGuid = (Guid)membershipUser.ProviderUserKey;
}

Software development tools and tips

Here are some software development tools and tips that can be helpful for developers.


Tools


MS Visual Studio - A top notch programming IDE that most developers and development firms use. Ultimate version is quite expensive. There is a free version Visual Studio Express. Also students can get free copy from Microsoft's Student Partner program.

MS SQL Server Express - Free database development tool by Microsoft

ReSharper -  A tool that when installed integrates with Visual Studio and provides you with hints for improving code, refactoring and identifying errors easily by highlighting them. This is highly recommended tool It can be a bit expensive to purchase. But there is a free trial available.

Bootstrap - Helps to quickly get your website CSS'ed. It had predefined classes, icons and scripts that can cut your development time.

JQuery - An open source, cross-browser collection of scripts that provide quick client side scripting of webpages. There are some premium plugins as well.

SVN - An open source version control. Creates copies of work committed by development team. Allows merging of code and reverting if to a specific version if need.


Some tips:


1. Dual monitors - Having 2 monitors is very common for developers. It provides more viewing space and helps reduce time spent on resizing and flipping between windows.

2. Skype, Lync or Team Viewer - Collaboration tools that helps your communicate, see  and even control other team members computer.

3. Take care of yourself - As a Developer you spend lots of time sitting in-front of your computer coding. Make a rule to get up and stretch or take a short walk every hour. Its sometimes nice to stand and code. You can try having a small stand that can help raise your keyboard and monitor.

4. Networking - Try to build a network or join a network of developers. This way you can gain more knowledge and make some friends.