A
Arpan
Consider the following code snippet (my main intention is to display
the current time in a Label control as & when this ASPX page is
accessed/refreshed):
<script runat="server">
Class Clock
Sub SetTime(ByVal intSec As Integer, ByVal intMin As Integer,
ByVal intHour As Integer)
Dim lblTime As New System.Web.UI.WebControls.Label
lblTime.Text = "Current Time: " & intHour & ":" & intMin &
":" & intSec
End Sub
End Class
Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)
Dim objClock As New Clock
objClock.SetTime(Second(Now), Minute(Now), Hour(Now))
End Sub
</script>
<form id="frmTime" runat="server">
<asp:Label id="lblTime" runat="server"/>
</form>
The above code doesn't render any text in the Label control i.e the
Label control doesn't show the current time. Why?
Thanks,
Arpan
the current time in a Label control as & when this ASPX page is
accessed/refreshed):
<script runat="server">
Class Clock
Sub SetTime(ByVal intSec As Integer, ByVal intMin As Integer,
ByVal intHour As Integer)
Dim lblTime As New System.Web.UI.WebControls.Label
lblTime.Text = "Current Time: " & intHour & ":" & intMin &
":" & intSec
End Sub
End Class
Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)
Dim objClock As New Clock
objClock.SetTime(Second(Now), Minute(Now), Hour(Now))
End Sub
</script>
<form id="frmTime" runat="server">
<asp:Label id="lblTime" runat="server"/>
</form>
The above code doesn't render any text in the Label control i.e the
Label control doesn't show the current time. Why?
Thanks,
Arpan