I have been over this for an hour and can't figure out why it does not work. Even though I get this error:
C:\begaspnet11\ch03\tio-variablescope1.aspx(7) : error BC30205: End of statement expected.
Dim strMyBlockVariableUsedInside.Text = "Block VariableUsed In Block"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\begaspnet11\ch03\tio-variablescope1.aspx(9) : error BC30451: Name 'strMyBlockVariableUsedInside' is not declared.
lblMessageBlockInBlock.Text = strMyBlockVariableUsedInside
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\begaspnet11\ch03\tio-variablescope1.aspx(10) : error BC30451: Name 'strProcVariable' is not declared.
lblMessageProcedure.Text = strProcVariable
Now this is my code and I don't see how it differs from the chapter 3 "tio-variablescope1.asp" It also tells me I didn't declare my variable and it appears I have.
Code:
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load()
Dim strMyProcVariable = "Procedure Variable"
If ISPostBack Then
Dim strMyBlockVariableUsedInside.Text = "Block VariableUsed In Block"
lblMessageBlockInBlock.Text = strMyBlockVariableUsedInside
lblMessageProcedure.Text = strProcVariable
End If
End Sub
</script>
<html>
<head>
<title>Variable Scope</title>
</head>
<body>
<form runat="server">
<asp:label id="lblMessageBlockInBlock" runat="server" text="DEFAULT_BlockInBlock">
</asp:label>
<br />
<asp:label id="lblMessageProcedure" runat="server" text="DEFAULT_Procedure">
</asp:label>
<asp:Button runat="server" text="submit"/>
</form>
</body>
</html>
I would appreciate help getting over this hump.