First include "System.Web.Security" namespace
Code:
using System.Web.Security;
then in your method (function) where you want to get user id write:
Membership.GetUser().ProviderUserKey;
if you want to add it to the string you must convert it to string but first check if the user id logged in
Code:
string userID;
if (User.Identity.IsAuthenticated)
{
userID = Membership.GetUser().ProviderUserKey.ToString();
}
Hope that this helps,
Haris