Hello
I would be grateful for some assistance getting the date to appear on my page, please.
This is the code in my aspx.vb file:
Dim Label As Object
Function ReturnDate() As String
Dim theDate As String = ""
Dim NumericDayofMonth As Integer = Date.Now.Day
Dim OrdinalSuffix As String = ""
Select Case NumericDayofMonth
Case 1, 21, 31
OrdinalSuffix = "<sup>st</sup>"
Case 2, 22
OrdinalSuffix = "<sup>nd</sup>"
Case 3, 23
OrdinalSuffix = "<sup>rd</sup>"
Case Else
OrdinalSuffix = "<sup>th</sup>"
End Select
Dim NumericMonthofYear As Integer = Date.Now.Month
Dim MonthofYear As String = ""
Select Case NumericMonthofYear
Case 1
MonthofYear = "January"
Case 2
MonthofYear = "February"
Case 3
MonthofYear = "March"
Case 4
MonthofYear = "April"
Case 5
MonthofYear = "May"
Case 6
MonthofYear = "June"
Case 7
MonthofYear = "July"
Case 8
MonthofYear = "August"
Case 9
MonthofYear = "September"
Case 10
MonthofYear = "October"
Case 11
MonthofYear = "November"
Case 12
MonthofYear = "December"
End Select
theDate &= DateTime.Now.Day.ToString() '1, 2, 3, 4 etc
theDate &= OrdinalSuffix & " " 'st, nd, rd, th
theDate &= MonthofYear & " " 'Jan, Feb etc
theDate &= DateTime.Now.Year.ToString() '2013, 2014 etc
Return theDate
End Function
I also have this line to show the date, but I am not sure where to place it in the aspx.vb file:
LblDate.Text = ReturnDate()
And in my aspx file, I have:
</style>
<asp:Label ID="LblDate" runat="server" class="labelStyle" Text="Label"></asp:Label>
<h1 class="dima">Text</h1>
Thanks for any help.