I want to expose a webmethod that will take in a username and password and login the user. How would I programmatically take these parameters and sign in a user to the site, so that after the webmethod is complete, the page reloads and the user is now “logged in”. I would like to avoid using the Login asp control because I would like to send these parameters in an ajax call to the webmethod and have it log the user in that way.
Share
I used this method on a Windows Form Application and it works fine:
Note that spUsername and spPassword are the ones you have to provide in this code: