I am new to VB.NET and ASP.NET and I am using a Deitel book in an attempt to learn a bit. Anyway, I am trying to display web forms in a browser but am having difficulty.
I have two labels (a title and system time) on the forms but when I run the browser, only one displays. I assume that the problem is not a "setup" thing since one label does display. Suggestions?
Here's the application snippet:
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents displayLabel As System.Web.UI.WebControls.Label
Protected WithEvents timeLabel As System.Web.UI.WebControls.Label
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
timeLabel.Text = String.Format("{02}:{12}:{22}", _
DateTime.Now.Hour, DateTime.Now.Minute, _
DateTime.Now.Second)
End Sub
#End Region
End Class
I have two labels (a title and system time) on the forms but when I run the browser, only one displays. I assume that the problem is not a "setup" thing since one label does display. Suggestions?
Here's the application snippet:
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents displayLabel As System.Web.UI.WebControls.Label
Protected WithEvents timeLabel As System.Web.UI.WebControls.Label
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
timeLabel.Text = String.Format("{02}:{12}:{22}", _
DateTime.Now.Hour, DateTime.Now.Minute, _
DateTime.Now.Second)
End Sub
#End Region
End Class