Re: Secure login from unsecured page



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');");
}




--
Misbah Arefin
https://mcp.support.microsoft.com/profile/MISBAH.AREFIN
http://dotnethitman.spaces.live.com
http://www.linkedin.com/in/misbaharefin




"BillAtWork" <BillAtWork@xxxxxxxxxxxxx> wrote in message news:03D07D41-0096-43C6-9C80-F1C32AA59834@xxxxxxxxxxxxxxxx
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!


.


Quantcast