⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asp_calendar.aspx

📁 东软内部材料(四)asp等相关的教学案例 
💻 ASPX
📖 第 1 页 / 共 2 页
字号:
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkVisible" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Visible =</td><td nowrap="nowrap"><select id="selVisible" size="1" runat="server" onchange="SetCheck('chkVisible')"><option>True</option><option>False</option></select></td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="checkbox" id="chkVisibleDate" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">VisibleDate =</td><td nowrap="nowrap"><input type="text" size="20" id="txtVisibleDate" runat="server" onkeypress="SetCheck('chkVisibleDate')" /></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkWidth" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Width =</td><td nowrap="nowrap"><input type="text" size="2" id="txtWidth" runat="server" onkeypress="SetCheck('chkWidth')" />px</td><td nowrap="nowrap"></td>
<td nowrap="nowrap"><input type="button" Value="Reset" onclick="javascript:location.href='http://<% = Request.ServerVariables["SERVER_NAME"] %><% = Request.Path %>'"></td><td nowrap="nowrap"></td><td nowrap="nowrap"><input type="submit" Value="Update" runat="server" /></td></tr>
</table>
</form>

<script language="C#" runat="server">

	void Page_Load(Object sender, EventArgs e)
	{
		outError.InnerHtml = "";

		try
		{
			if (IsPostBack)
			{
				if (chkAccessKey.Checked) MyControl.AccessKey = txtAccessKey.Value;
				if (chkBackColor.Checked) MyControl.BackColor = Color.FromName(txtBackColor.Value);
				if (chkBorderColor.Checked) MyControl.BorderColor = Color.FromName(txtBorderColor.Value);
				if (chkBorderStyle.Checked) MyControl.BorderStyle = (BorderStyle)Convert.ToInt32(selBorderStyle.Value);
				if (chkBorderWidth.Checked) MyControl.BorderWidth = Unit.Pixel(Convert.ToInt32(txtBorderWidth.Value));
				if (chkCellPadding.Checked) MyControl.CellPadding = Convert.ToInt32(txtCellPadding.Value);
				if (chkCellSpacing.Checked) MyControl.CellSpacing = Convert.ToInt32(txtCellSpacing.Value);
				if (chkDayNameFormat.Checked) MyControl.DayNameFormat = (DayNameFormat)Convert.ToInt32(selDayNameFormat.Value);
				if (chkEnabled.Checked) MyControl.Enabled = Convert.ToBoolean(selEnabled.Value);
				if (chkFirstDayOfWeek.Checked) MyControl.FirstDayOfWeek = (FirstDayOfWeek)Convert.ToInt32(selFirstDayOfWeek.Value);
				if (chkForeColor.Checked) MyControl.ForeColor = Color.FromName(txtForeColor.Value);
				if (chkHeight.Checked) MyControl.Height = Unit.Pixel(Convert.ToInt32(txtHeight.Value));
				if (chkNextMonthText.Checked) MyControl.NextMonthText = txtNextMonthText.Value;
				if (chkNextPrevFormat.Checked) MyControl.NextPrevFormat = (NextPrevFormat)Convert.ToInt32(selNextPrevFormat.Value);
				if (chkPrevMonthText.Checked) MyControl.PrevMonthText = txtPrevMonthText.Value;
				if (chkSelectedDate.Checked) MyControl.SelectedDate = Convert.ToDateTime(txtSelectedDate.Value);
				if (chkSelectMonthText.Checked) MyControl.SelectMonthText = txtSelectMonthText.Value;
				if (chkSelectWeekText.Checked) MyControl.SelectWeekText = txtSelectWeekText.Value;
				if (chkShowDayHeader.Checked) MyControl.ShowDayHeader = Convert.ToBoolean(selShowDayHeader.Value);
				if (chkShowGridLines.Checked) MyControl.ShowGridLines = Convert.ToBoolean(selShowGridLines.Value);
				if (chkShowNextPrevMonth.Checked) MyControl.ShowNextPrevMonth = Convert.ToBoolean(selShowNextPrevMonth.Value);
				if (chkShowTitle.Checked) MyControl.ShowTitle = Convert.ToBoolean(selShowTitle.Value);
				if (chkTitleFormat.Checked) MyControl.TitleFormat = (TitleFormat)Convert.ToInt32(selTitleFormat.Value);
				if (chkTodaysDate.Checked) MyControl.TodaysDate = Convert.ToDateTime(txtTodaysDate.Value);
				if (chkToolTip.Checked) MyControl.ToolTip = txtToolTip.Value;
				if (chkVisible.Checked) MyControl.Visible = Convert.ToBoolean(selVisible.Value);
				if (chkVisibleDate.Checked) MyControl.VisibleDate = Convert.ToDateTime(txtVisibleDate.Value);
				if (chkWidth.Checked) MyControl.Width = Unit.Pixel(Convert.ToInt32(txtWidth.Value));
			}

			txtAccessKey.Value = MyControl.AccessKey;
			txtBackColor.Value = MyControl.BackColor.Name;
			txtBorderColor.Value = MyControl.BorderColor.Name;
			selBorderStyle.Value = MyControl.BorderStyle.ToString();
			txtBorderWidth.Value = MyControl.BorderWidth.Value.ToString();
			txtCellPadding.Value = MyControl.CellPadding.ToString();
			txtCellSpacing.Value = MyControl.CellSpacing.ToString();
			selDayNameFormat.Value = MyControl.DayNameFormat.ToString();
			selEnabled.Value = MyControl.Enabled.ToString();
			selFirstDayOfWeek.Value = MyControl.FirstDayOfWeek.ToString();
			txtForeColor.Value = MyControl.ForeColor.Name;
			txtHeight.Value = MyControl.Height.Value.ToString();
			txtNextMonthText.Value = MyControl.NextMonthText;
			selNextPrevFormat.Value = MyControl.NextPrevFormat.ToString();
			txtPrevMonthText.Value = MyControl.PrevMonthText;
			txtSelectedDate.Value = MyControl.SelectedDate.ToString();
			txtSelectMonthText.Value = MyControl.SelectMonthText.ToString();
			txtSelectWeekText.Value = MyControl.SelectWeekText.ToString();
			selShowDayHeader.Value = MyControl.ShowDayHeader.ToString();
			selShowGridLines.Value = MyControl.ShowGridLines.ToString();
			selShowNextPrevMonth.Value = MyControl.ShowNextPrevMonth.ToString();
			selShowTitle.Value = MyControl.ShowTitle.ToString();
			selTitleFormat.Value = MyControl.TitleFormat.ToString();
			txtTodaysDate.Value = MyControl.TodaysDate.ToString();
			txtToolTip.Value = MyControl.ToolTip;
			selVisible.Value = MyControl.Visible.ToString();
			txtVisibleDate.Value = MyControl.VisibleDate.ToString();
			txtWidth.Value = MyControl.Width.Value.ToString();
		}
		catch (Exception objError)
		{
			outError.InnerHtml = "<b>* Error</b>: " + objError.Message + "<p />";
		}
	}	
	
</script>

<!--------------------------------------------------------------------------->
<!-- #include file="foot.inc" -->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -