Use Constant (C#) : Const « Language Basics « ASP.Net






Use Constant (C#)

<%@ Page Language="c#" %>
<script runat="server">

void Page_Load()
{
    const int AbsoluteZero = -273;
    lblOut.Text = Convert.ToString(AbsoluteZero);
}
</script>
<html>
<head>
<title>Creating Variables Example</title>
</head>
<body>
    <asp:Label runat="server" ID="lblOut"/><br/>
</body>
</html>

           
       








Related examples in the same category