ASP.NET Adding Javascript to page if page not secure
<p>I'm trying to add some share this javascript in between the head tags of an asp.net page but only if the page is not secure (!Request.IsSecureConnection). How do I get the code in the head tags to check for secure connection and then write the javascript if not secure. I've tried using &lt;% %> blocks and RegisterStartupScriptBlock and it's not working</p>

<p>UPDATE:</p>

<p>Was able to get it to work using this in the Page_Load</p>

<pre><code>if(!Request.IsSecureConnection)
{
    HtmlGenericControl Include = new HtmlGenericControl("script");
    Include.Attributes.Add("type", "text/javascript");
  Include.Attributes.Add("src", "http....");
  this.Page.Header.Controls.Add(Include);
}
</code></pre>
