In an aspx page I get the Windows username with the function Request.LogonUserIdentity.Name. This function returns a string in the format \"domain\\user\".
If you are using Windows Authentication.
This can simply be achieved by calling System.Environment.UserName which will give you the user name only.
If you want only the Domain name you can use System.Environment.UserDomainName