title: adding https dynamically to url
body: <p>I want to set https to my url dynamically. I just want to use https on my login and basket aspx files. Here is my codes:</p>
  
  <p>In html file:</p>
  
  <pre><code>   &lt;span runat="server" id="spnGiris"&gt;&lt;a href="&lt;%#GetDomain(true)%&gt;/Login.aspx"&gt;Personel
                  Girişi&amp;nbsp;&amp;nbsp;&lt;/a&gt;&lt;/span&gt;
  &lt;a href="&lt;%#GetDomain(false)%&gt;/Default.aspx?q=e"&gt;Çıkış&lt;/a&gt;&lt;/span&gt;
  </code></pre>
  
  <p>In server side:</p>
  
  <pre><code> public string GetDomain(bool https)
      {
          string protocol = https ? "https" : "http";
          string s = Request.Url.Host.ToLower();
          if (s.Equals("localhost"))
              return protocol + "://localhost:14553";
          return protocol + "://" + ConfigurationManager.AppSettings["domainName"];
      }
  </code></pre>
  
  <p>I put breakpoint on GetDomain and https is always false in login.aspx. But In basket.aspx everything is ok.
  Do you have any suggestion? </p>