开发者

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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜