ASP.Net/Data Binding/Function — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 11:52, 26 мая 2010

Define function with Date value type

<script language="vb" runat="server">
  Sub Page_Load()
   Dim DueDate As Date
   Dim CheckOutDate As Date
   CheckoutDate = Now()
   DueDate = FindDueDate(CheckoutDate)
   Message1.text = "<br>Your books were checked OUT on "& CheckOutDate
   Message2.text = "<br>Your books are due on " & DueDate
  End Sub
 
  Function FindDueDate(CheckOutDate As Date) As Date
     return DateValue(DateAdd("d", 14, CheckOutDate)) 
  End Function
</script>
<html>
<head>
<title>Sample Function Page</title>
</head>
<body>
  <h2>Thank you for using the On-Line Library.</h2>
  <asp:label id="message1" runat="server"/>
  <asp:label id="message2" runat="server"/>
</body>
</html>