Assign Date and Integer value to asp:textbox without converting (VB.net) : Date Time « Language Basics « ASP.Net






Assign Date and Integer value to asp:textbox without converting (VB.net)

<script language="vb" runat="server">
Sub Page_Load()
  Dim CapitalCityOfUK As String
  Dim NumberOfStates As Integer
  Dim IndependenceDay As Date

  CapitalCityOfUK = "London"
  NumberOfStates = 50
  IndependenceDay = #7/4/1863#

  Display1.Text = CapitalCityOfUK 
  Display2.Text = NumberOfStates
  Display3.Text = IndependenceDay
End Sub
</script>

<html>
<head>
<title>Creating Variables Example</title>
</head>
<body>
  The contents of CapitalCityOfUk is: 
  <asp:label id="Display1" runat="server" />
  <br>The contents of NumberOfStates is: 
  <asp:label id="Display2" runat="server" />
  <br>The contents of IndependenceDay is: 
  <asp:label id="Display3" runat="server" />
</body>
</html>

           
       








Related examples in the same category

1.Year() function (VB.net)
2.Get Today date (VB.net)
3.Get Time Of a Day (VB.net)
4.DateTime constructor: no parameters (VB.net)
5.DateTime constructor: year, month, day (VB.net)
6.DateTime constructor: year, month, day, hour, minute, second (VB.net)
7.DateTime constructor: milli-second (VB.net)
8.Get Hour, Second and Minute from Current time (VB.net)
9.Assign date in form of '#3/6/2003#' to asp:Label (VB.net)
10.Convert Current date to Long Time String and set to asp:Label (VB.net)
11.Convert Current date to Long Date String and set to asp:Label (VB.net)
12.Convert Current date to Short Time String and set to asp:Label (VB.net)
13.Convert Current date to Short Date String and set to asp:Label (VB.net)
14.Time limit validation (C#)
15.new DateTime() (C#)
16.DateTime constructor: year, month, day (C#)
17.DateTime constructor: year, month, day, hour, minute, second (C#)
18.DateTime constructor: milli-seconds (C#)
19.Date Comparison (C#)
20.Convert text in asp textbox into Date (C#)
21.Date calculation: plus 7 days (C#)