Welcome aboard! We are happy you are here and wish you good net-raft!
<% @Page Language="C#" %>
<!-- code section -->
<script runat="server">
private void check_security(object sender, EventArgs e)
{
string url = "";
if (Request.ServerVariables["HTTPS"] == "on")
{
url = "https://" + Request.ServerVariables["SERVER_NAME"] + Request.RawUrl.ToString();
Response.Write(url);
}
else
{
url = "http://" + Request.ServerVariables["SERVER_NAME"] + Request.RawUrl.ToString();
Response.Write(url);
}
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<input runat="server" id="button1" type="submit" value="click" OnServerClick="check_security"/>
</form>
</body>
</html>
The most helpful C# solutions