Secure login from unsecured page

B

BillAtWork

Hi,

Can anyone help me with advice/articles about this? I'd like to allow users
to either sign up or login from my initial homepage, but I don't want the
overhead of having EVERY visitor to that page invoking a secure connection.
So everyone visits http://www.mysite.com but only those users that choose to
signup/login pass data over https. I'd like to avoid the alternative of
putting a link on the homepage to a secured page, if possible, hence this
post! :)

Something similar, I think, to the Godaddy.com homepage - you visit
"http://www.godaddy.com" (note this is not over https), but when you enter
your name/password and click "secure login" this appears to happen over a
secure connection.

Thanks!
 
M

Misbah Arefin

In your Page_Load() do this

if(!IsPostBack)
{
//This is how to POST back to another URL
string script = "<script language='javascript'> " +
"function doSecurePostBack(sNewFormAction){ " +
"document.forms[0].action = sNewFormAction; " +
"} " +
"</script>";
RegisterClientScriptBlock("postBackCall", script);

//add this to our 'secure login' button so that we can POST back to a
differnet URL
btnSecureLogin.Attributes.Add("onclick",
"doSecurePostBack('https://www.yoursite.com/login.aspx');");
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top