开发者

security warning window in IE pops up on https page

My problem is with IE. When I search product (means when I enter product name in search box) from viewcart page before products are displayed the security warning window is getting popup:

Do you want to view only the webpage contect that was delivered securly? This web page contain secure HTTPS connection.

My viewcart page has url https:localhost:52470/173_201_149_151/ViewCart.aspx and Search page has also https.

I know that security warning is displayed due to https but I dont want this security window. Is there any way to avoid this securit开发者_开发技巧y warning window?


This usually occurs when your page URL protocol is HTTPS, but you have resources embedded in the page i.e. CSS, JavaScript, images etc, that have hardcoded protocols of HTTP.

This is quite easy to embed the correct protocol server-side in ASP.NET via Request.Url.Scheme.

When embedding third party JavaScript includes, you can use javascript to embed the correct protocol, for example:

<script type="text/javascript">
    var protocol = (("https:" == document.location.protocol) ? "https" : "http");
    document.write(unescape("%3Cscript src='" + protocol + "third-party.com/script.js' type='text/javascript'%3E%3C/script%3E"));
</script>

If you are having trouble tracking down the insecure resources, I would recommend using Fiddler2, a debugging proxy, which will highlight the issues.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜