tags:

views:

74

answers:

2
+1  Q: 

asp.net website

i have this website, and this specific page is secure, but when it postbacks, it postbacks to an unsecure page. How to fix that?!

I am using ASP.NET Wizard. I have this page - checkout.aspx, and this control checkout.ascx contained by the page. Now, the encode to ensure ssl is inside the page like this:

  protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
         if (!HttpContext.Current.Request.IsSecureConnection) {
                HttpContext.Current.Response.Redirect(SiteNavigation.ResolveAbsoluteUrl(true, HttpContext.Current.Request.Url.PathAndQuery));
            }

    }

The wizard is inside checkout.ascx control. Now, it uses postbacks to go to the next step, but it postbacks to an insecure page (meaning it drops "s" from https), which hits my ensuresslenabled code, and it redirects itself to the checkout page again.

A: 

If the user is not logged in, he will be redirected to an unsecured page like login/register page. Make your question more clear.

pokrate
.....wat? sorry is it only me who didn't get your answer?
Shoban
Question was edited after my answer. Earlier the question comprised of just one line shown above.
pokrate
+1  A: 

Perhaps find any instances of hardcoded http: in the related code. Usually a postback will respect the protocol being used.

p.campbell
there isn't one.
progtick