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>
Related examples in the same category