Is the form hosted on the same site (ASPDNSF), or are you redirecting the user from a different website?
If from the same site, have a look at how the native signin logic works. This can be seen on the signin page (you may need to look into the control) or checkoutanon.aspx.cs.
Search for AppLogic.ExecuteSigninLogic(CurrentCustomerID, NewCustomerID); in your solution.
If on an external site, you are going to need a few additional steps, which can get complicated. All possible, but more involved.
Enterprise AspDotNetStorefront Development Partner
Web Design, Platform Enhancements & Managed Services