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:
In html file:
<span runat="server" id="spnGiris"><a href="<%#GetDomain(true)%>/Login.aspx">Personel
Girişi </a></span>
<a href="<%#GetDomain(false)%>/Default.aspx?q=e">Çıkış</a></span>
In server side:
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"];
}
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?
I changed <%#GetDomain(true)%> with <%=GetDomain(true)%> and it resolved.