init
This commit is contained in:
172
CH46/main.aspx
172
CH46/main.aspx
@@ -1,86 +1,86 @@
|
||||
<%@ Page Language="C#" CodeBehind="main.aspx.cs" Inherits="CH46.main" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<script runat="server">
|
||||
|
||||
</script>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>Main</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="fdssdf" runat="server">
|
||||
<div>
|
||||
<asp:TextBox ID="txtInit" Runat="server">My Initial Value</asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
|
||||
Runat="server" Text="Please change the value of the textBox"
|
||||
ControlToValidate="txtInit" InitialValue="My Initial Value" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" Runat="server"
|
||||
Text="Do not leave empty" ControlToValidate="txtInit"></asp:RequiredFieldValidator>
|
||||
<br />
|
||||
<br />
|
||||
<asp:DropDownList id="DropDownList1" runat="server">
|
||||
<asp:ListItem Selected="True">Select a profession</asp:ListItem>
|
||||
<asp:ListItem>Programmer</asp:ListItem>
|
||||
<asp:ListItem>Lawyer</asp:ListItem>
|
||||
<asp:ListItem>Doctor</asp:ListItem>
|
||||
<asp:ListItem>Artist</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
<asp:RequiredFieldValidator id="RequiredFieldValidator3"
|
||||
runat="server" Text="Please make a selection"
|
||||
ControlToValidate="DropDownList1"
|
||||
InitialValue="Select a profession" Display="Dynamic" ForeColor="#FF3300"></asp:RequiredFieldValidator>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<asp:TextBox ID="txtDepart" runat="server" />
|
||||
<asp:RangeValidator ID="rgvDepart" runat="server" ControlToValidate="txtDepart"
|
||||
Display="Dynamic" ErrorMessage="Less than 2 weeks" ForeColor="Red"></asp:RangeValidator>
|
||||
<br />
|
||||
Arrival Date:
|
||||
<asp:TextBox ID="txtArrival" runat="server" />
|
||||
<asp:RangeValidator ID="rgvArrival" runat="server"
|
||||
Text="You must only select a date within the next two weeks."
|
||||
ControlToValidate="txtArrival" Type="Date" Display="Dynamic" ErrorMessage="Less than 2 weeks" ForeColor="Red"></asp:RangeValidator>
|
||||
<br />
|
||||
Select your arrival date:<br />
|
||||
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
|
||||
<asp:ListItem>Departure</asp:ListItem>
|
||||
<asp:ListItem>Arrival</asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
<br />
|
||||
<asp:Calendar ID="Calendar1" runat="server"
|
||||
OnSelectionChanged="Calendar1_SelectionChanged"
|
||||
DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#3366CC" BorderColor="#3366CC" BorderWidth="1px" CellPadding="1"
|
||||
DayHeaderStyle-BackColor="#99CCFF" ForeColor="#3366CC" Height="200px" Width="220px">
|
||||
<NextPrevStyle Font-Size="8pt" ForeColor="#CCCCCC" />
|
||||
<OtherMonthDayStyle ForeColor="#999999" />
|
||||
<SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
|
||||
<SelectorStyle BackColor="#99CCFF" ForeColor="#336666" />
|
||||
<TitleStyle BackColor="#003399" BorderColor="#3366CC" Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCCC" Height="25px" />
|
||||
<TodayDayStyle BackColor="#99CCFF" ForeColor="#0000FF" />
|
||||
<WeekendDayStyle BackColor="#CCCCFF" />
|
||||
</asp:Calendar>
|
||||
|
||||
<asp:RadioButtonList ID="rdoTest" runat="server">
|
||||
<asp:ListItem>Departure</asp:ListItem>
|
||||
<asp:ListItem>Arrival</asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
<br />
|
||||
<asp:Button ID="Button1" runat="server" Text="Submit"
|
||||
OnClick="Button1_Click" />
|
||||
<br />
|
||||
<asp:Label ID="Label11" runat="server"></asp:Label>
|
||||
|
||||
<asp:Button ID="btnTest" runat="server" Text="Tester" />
|
||||
|
||||
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
<%-- $1$ <%@ Page Language="C#" CodeBehind="main.aspx.cs" Inherits="CH46.main" %> #1# --%>
|
||||
<%-- --%>
|
||||
<%-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> --%>
|
||||
<%-- --%>
|
||||
<%-- <script runat="server"> --%>
|
||||
<%-- --%>
|
||||
<%-- </script> --%>
|
||||
<%-- --%>
|
||||
<%-- <html xmlns="http://www.w3.org/1999/xhtml"> --%>
|
||||
<%-- <head runat="server"> --%>
|
||||
<%-- <title>Main</title> --%>
|
||||
<%-- </head> --%>
|
||||
<%-- <body> --%>
|
||||
<%-- <form id="fdssdf" runat="server"> --%>
|
||||
<%-- <div> --%>
|
||||
<%-- <asp:TextBox ID="txtInit" Runat="server">My Initial Value</asp:TextBox> --%>
|
||||
<%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator1" --%>
|
||||
<%-- Runat="server" Text="Please change the value of the textBox" --%>
|
||||
<%-- ControlToValidate="txtInit" InitialValue="My Initial Value" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator> --%>
|
||||
<%-- <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Runat="server" --%>
|
||||
<%-- Text="Do not leave empty" ControlToValidate="txtInit"></asp:RequiredFieldValidator> --%>
|
||||
<%-- <br /> --%>
|
||||
<%-- <br /> --%>
|
||||
<%-- <asp:DropDownList id="DropDownList1" runat="server"> --%>
|
||||
<%-- <asp:ListItem Selected="True">Select a profession</asp:ListItem> --%>
|
||||
<%-- <asp:ListItem>Programmer</asp:ListItem> --%>
|
||||
<%-- <asp:ListItem>Lawyer</asp:ListItem> --%>
|
||||
<%-- <asp:ListItem>Doctor</asp:ListItem> --%>
|
||||
<%-- <asp:ListItem>Artist</asp:ListItem> --%>
|
||||
<%-- </asp:DropDownList> --%>
|
||||
<%-- --%>
|
||||
<%-- <asp:RequiredFieldValidator id="RequiredFieldValidator3" --%>
|
||||
<%-- runat="server" Text="Please make a selection" --%>
|
||||
<%-- ControlToValidate="DropDownList1" --%>
|
||||
<%-- InitialValue="Select a profession" Display="Dynamic" ForeColor="#FF3300"></asp:RequiredFieldValidator> --%>
|
||||
<%-- --%>
|
||||
<%-- <br /> --%>
|
||||
<%-- <br /> --%>
|
||||
<%-- --%>
|
||||
<%-- <asp:TextBox ID="txtDepart" runat="server" /> --%>
|
||||
<%-- <asp:RangeValidator ID="rgvDepart" runat="server" ControlToValidate="txtDepart" --%>
|
||||
<%-- Display="Dynamic" ErrorMessage="Less than 2 weeks" ForeColor="Red"></asp:RangeValidator> --%>
|
||||
<%-- <br /> --%>
|
||||
<%-- Arrival Date: --%>
|
||||
<%-- <asp:TextBox ID="txtArrival" runat="server" /> --%>
|
||||
<%-- <asp:RangeValidator ID="rgvArrival" runat="server" --%>
|
||||
<%-- Text="You must only select a date within the next two weeks." --%>
|
||||
<%-- ControlToValidate="txtArrival" Type="Date" Display="Dynamic" ErrorMessage="Less than 2 weeks" ForeColor="Red"></asp:RangeValidator> --%>
|
||||
<%-- <br /> --%>
|
||||
<%-- Select your arrival date:<br /> --%>
|
||||
<%-- <asp:RadioButtonList ID="RadioButtonList1" runat="server"> --%>
|
||||
<%-- <asp:ListItem>Departure</asp:ListItem> --%>
|
||||
<%-- <asp:ListItem>Arrival</asp:ListItem> --%>
|
||||
<%-- </asp:RadioButtonList> --%>
|
||||
<%-- <br /> --%>
|
||||
<%-- <asp:Calendar ID="Calendar1" runat="server" --%>
|
||||
<%-- $1$ OnSelectionChanged="Calendar1_SelectionChanged" #1# --%>
|
||||
<%-- DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#3366CC" BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" --%>
|
||||
<%-- DayHeaderStyle-BackColor="#99CCFF" ForeColor="#3366CC" Height="200px" Width="220px"> --%>
|
||||
<%-- <NextPrevStyle Font-Size="8pt" ForeColor="#CCCCCC" /> --%>
|
||||
<%-- <OtherMonthDayStyle ForeColor="#999999" /> --%>
|
||||
<%-- <SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" /> --%>
|
||||
<%-- <SelectorStyle BackColor="#99CCFF" ForeColor="#336666" /> --%>
|
||||
<%-- <TitleStyle BackColor="#003399" BorderColor="#3366CC" Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCCC" Height="25px" /> --%>
|
||||
<%-- <TodayDayStyle BackColor="#99CCFF" ForeColor="#0000FF" /> --%>
|
||||
<%-- <WeekendDayStyle BackColor="#CCCCFF" /> --%>
|
||||
<%-- </asp:Calendar> --%>
|
||||
<%-- --%>
|
||||
<%-- <asp:RadioButtonList ID="rdoTest" runat="server"> --%>
|
||||
<%-- <asp:ListItem>Departure</asp:ListItem> --%>
|
||||
<%-- <asp:ListItem>Arrival</asp:ListItem> --%>
|
||||
<%-- </asp:RadioButtonList> --%>
|
||||
<%-- <br /> --%>
|
||||
<%-- $1$ <asp:Button ID="Button1" runat="server" Text="Submit" #1# --%>
|
||||
<%-- $1$ $2$ OnClick="Button1_Click" /> #2# #1# --%>
|
||||
<%-- $1$ <br /> #1# --%>
|
||||
<%-- <asp:Label ID="Label11" runat="server"></asp:Label> --%>
|
||||
<%-- --%>
|
||||
<%-- <asp:Button ID="btnTest" runat="server" Text="Tester" /> --%>
|
||||
<%-- --%>
|
||||
<%-- <asp:Button ID="btnSubmit" runat="server" Text="Submit" /> --%>
|
||||
<%-- </div> --%>
|
||||
<%-- --%>
|
||||
<%-- </form> --%>
|
||||
<%-- </body> --%>
|
||||
<%-- </html> --%>
|
@@ -1,44 +1,44 @@
|
||||
using System;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace CH46
|
||||
{
|
||||
public partial class main : Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
DateTime dptMin, dptMax;
|
||||
rgvDepart.MinimumValue = DateTime.Now.ToShortDateString();
|
||||
rgvDepart.MaximumValue = DateTime.Now.AddDays(30).ToShortDateString();
|
||||
txtDepart.Text = DateTime.Now.ToShortDateString();
|
||||
|
||||
dptMin = DateTime.Parse(txtDepart.Text);
|
||||
dptMax = Convert.ToDateTime(txtDepart.Text.ToString());
|
||||
|
||||
RangeValidator1.MinimumValue = dptMin.AddDays(14).ToShortDateString();
|
||||
RangeValidator1.MaximumValue = dptMax.AddDays(14).ToShortDateString();
|
||||
|
||||
txtArrival.Text = RangeValidator1.MaximumValue.ToString();
|
||||
}
|
||||
|
||||
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (rdoTest.SelectedValue == "Arrival")
|
||||
{
|
||||
txtArrival.Text = Calendar1.SelectedDate.ToShortDateString();
|
||||
}
|
||||
else if (rdoTest.SelectedValue == "Departure")
|
||||
{
|
||||
txtDepart.Text = Calendar1.SelectedDate.ToShortDateString();
|
||||
}
|
||||
}
|
||||
|
||||
protected void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Page.IsValid)
|
||||
{
|
||||
Label1.Text = "You are set to arrive on: " + txtArrival.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// using System;
|
||||
// using System.Web.UI;
|
||||
//
|
||||
// namespace CH46
|
||||
// {
|
||||
// public partial class main : Page
|
||||
// {
|
||||
// protected void Page_Load(object sender, EventArgs e)
|
||||
// {
|
||||
// DateTime dptMin, dptMax;
|
||||
// rgvDepart.MinimumValue = DateTime.Now.ToShortDateString();
|
||||
// rgvDepart.MaximumValue = DateTime.Now.AddDays(30).ToShortDateString();
|
||||
// txtDepart.Text = DateTime.Now.ToShortDateString();
|
||||
//
|
||||
// dptMin = DateTime.Parse(txtDepart.Text);
|
||||
// dptMax = Convert.ToDateTime(txtDepart.Text.ToString());
|
||||
//
|
||||
// RangeValidator1.MinimumValue = dptMin.AddDays(14).ToShortDateString();
|
||||
// RangeValidator1.MaximumValue = dptMax.AddDays(14).ToShortDateString();
|
||||
//
|
||||
// txtArrival.Text = RangeValidator1.MaximumValue.ToString();
|
||||
// }
|
||||
//
|
||||
// protected void Calendar1_SelectionChanged(object sender, EventArgs e)
|
||||
// {
|
||||
// if (rdoTest.SelectedValue == "Arrival")
|
||||
// {
|
||||
// txtArrival.Text = Calendar1.SelectedDate.ToShortDateString();
|
||||
// }
|
||||
// else if (rdoTest.SelectedValue == "Departure")
|
||||
// {
|
||||
// txtDepart.Text = Calendar1.SelectedDate.ToShortDateString();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// protected void Button1_Click(object sender, EventArgs e)
|
||||
// {
|
||||
// if (Page.IsValid)
|
||||
// {
|
||||
// Label1.Text = "You are set to arrive on: " + txtArrival.Text;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
Reference in New Issue
Block a user