Total Pageviews

Sunday, July 13, 2014

Accessing parent frames using JQuery

   $(function () {
            $(window).load(function () {
                var frame = window.parent.$('frame[name="frmFrame"]')[0].contentDocument;
                if ($(frame).find('.classname').is(':visible')) {
                        //Do something
                }
                else {
                     //Do something
                }

            })
        })

HTTP to HTTPS Redirect using Rewrite module

Rule to redirect to HTPS, Illustrated domain is treated as www.yourdomain.com.au, if is www.yourdomain.com the pattern will be pattern="^www\.yourdomain\.com$"

     <rule name="Redirect to HTTPS" enabled="true" stopProcessing="true">
                    <match url=".*" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                        <add input="{HTTP_HOST}" pattern="^www\.yourdomain.com\.au$" />
                        <add input="{HttpsRedirects:{REQUEST_URI}}" pattern="(.+)" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{C:1}" appendQueryString="false" redirectType="SeeOther" />
                </rule>

Pages which are to be redirect, Page ending .aspx and extention less are considered.

  <rewriteMaps>
                <rewriteMap name="HttpsRedirects">
                    <add key="/content_common/application.aspx" value="/content_common/application.aspx" />
                    <add key="/content_common/application" value="/content_common/application" />
</rewriteMap>
</rewriteMaps>