redirecting with javascript injected from code behind not working
<p>this is the property which give me site root path</p>

<pre><code>public static string SiteRootPath
    {
        get
        {
            string host = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority);
            string appRootUrl = HttpContext.Current.Request.ApplicationPath;
            if (string.IsNullOrEmpty(appRootUrl) || appRootUrl == "/")
            {
                return host + "/";
            }
            else
            {
                return host + appRootUrl + "/";
            }
        }
    }
</code></pre>

<p>i do like this</p>

<pre><code>string path = EMS.DAL.DALHelper.SiteRootPath + "Home.aspx";
</code></pre>

<p>then i do this</p>

<pre><code>string script = "&lt;script language='javascript' &gt;alert('User registered successfully');window.location.replace('" + path + "');&lt;/script&gt;";
Page.RegisterStartupScript("alert", script);
</code></pre>

<p>This redirects me to home page and works perfectly fine on localhost but not on the IIS where the site is published.</p>

<p>when i check the page source only this is found "alert('User registered successfully');" inside script tags ??</p>

<p>Not able to solve it.</p>

<p>Any ideas ??</p>
