Mega Code Archive

 
Categories / ASP.Net / Language Basics
 

Block-level variables (C#)

<%@ Page Language="c#" %> <script runat="server"> void Page_Load() {   if(1==1)   {       string strBlockLevelVariable;       strBlockLevelVariable = "Very Short Lived!";          lblMessage.Text = strBlockLevelVariable;   } } </script> <html> <head> <title>Creating Variables Example</title> </head> <body>     <asp:Label runat="server" ID="lblMessage"/><br/> </body> </html>