<%@ Page Language="C#" Debug="true" %>
<script runat="server">
void Page_Load()
{
if (Page.IsPostBack) {
DateTime MyDate;
MyDate = Convert.ToDateTime(txtInput.Text);
MyDate = MyDate + TimeSpan.FromDays(7);
lblOut.Text = Convert.ToString(MyDate);
}
}
</script>
<html>
<head>
<title>Creating Variables Example</title>
</head>
<body>
<form runat="server">
Please enter a date, such as 10/31/2006
<asp:TextBox runat="server" ID="txtInput">10/31/2006</asp:TextBox><br/>
<asp:Button runat="server" Text="Button"></asp:Button><br/>
One week from the day you entered would be:
<asp:Label runat="server" ID="lblOut"/><br/>
</form>
</body>
</html>
|