I use the following code to hash passwords:
string passw = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, "SHA1");
Above works just fine but I get a warning which says: Warning 103
'System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(string, string)' is obsolete: 'The recommended alternative is to use the Membership APIs, such as Membership.CreateUser.
So far I have not being able to find the equivalent code using the membership API.