tags:

views:

456

answers:

1

I want to redirect to a page that and force https:

e.g

Response.Redirect("~/Login.aspx");

I want to redirect to

 https://myserver/Login.aspx

how can i force https?

+2  A: 

Thanks Silky for starting me off.

I've ended up with

  var url = String.Format("https://{0}{1}", 
      Request.ServerVariables["HTTP_HOST"] ,
      ResolveUrl("~/Login.aspx"));

      Response.Redirect(url);
John Nolan
Note you can get the Host via: this.Request.Url.Host
Noon Silk
probably best to plump for DNSSafeHost in this case
John Nolan