In the SitePoint book, “Build Your Own ASP.NET 4 Website Using C# & VB”, there is an example of a survey page. The author’s example does not work as published and gives the error, " ‘feedbackLabel’ is not declared. It may be inaccessible due to its protection level." I have tried all of the access modifiers but that didn’t fix it.
The calling statement is:
"asp:Label id="feedbackLabel" runat="server"
and the sub is:
script runat="server"
Sub Click(ByVal s As Object, ByVal e As EventArgs)
Dim i As Integer
feedbackLabel.Text = "Your name is: " & name.Value & "br/"
feedbackLabel.Text += "Your email is: " & email.Value & "br "
feedbackLabel.Text += "You like to work with:br "
For i = 0 To serverModel.Items.Count - 1
If serverModel.Items(i).Selected Then
feedbackLabel.Text += " - " & _
serverModel.Items(i).Text & "br "
End If
Next i
feedbackLabel.Text += "You like .NET: " & likeDotNet.Value
End Sub
script"
The book is: Build Your Own ASP.NET 4 Website Using C# & VB
I’m using Visual Studio 2017 on Windows 10
Any help would be greatly appreciated.