I’m using the asp.net login control and for now the functionality is on its own separate page, which will eventually work in SSL. However, I’m thinking it’d also be interesting to try and put the login control on the homepage like many sites do these days.
How the functionality set-up so that the homepage works via regular HTTP but the login itself works with HTTPS?
Thanks.
You could create a form as follows:
Notice the
runat="server"attribute is missing and also theactionattribute specifies HTTPS. Theusernameandpasswordparameters will be sent to the server encrypted.On the dedicated login page, check for
Request.Form["username"]andRequest.Form["password"]. If specified, validate the credentials against your user database.If the login is unsuccessful, let them try again using your login control.