Custom Date Control (ASP.NET)

zhaozj2021-02-16  91

I don't know how little ASP.NET, use Web Matrix a date selection control, let everyone laugh.

The control code is as follows:

<%

...

@ Control classname = "CustomCalender" autoeventwireup = "false" language = "c #" targetschema = "http://schemas.microsoft.com/intellisense/ie5"

%>

<

Script

Runat

= "Server"

>

...

private void Calendar1_SelectionChanged (System.Object sender, System.EventArgs e) ... {TextBox1.Text = Calendar2.SelectedDate.ToShortDateString (); Panel1.Visible = false;} private void OnClick (System.Object sender, System.EventArgs e ) ... {IF (Panel1.visible) ... {Panel1.visible = false;} else ... {panel1.visible = true;}}

Script

>

INSERT Content Here

->

<

ASP: TEXTBOX

id

= "TextBox1"

Runat

= "Server"

>

ASP: TEXTBOX

>

<

ASP: Button

id

= "Button1"

Onclick

= "Onclick"

Runat

= "Server"

Size

= "43"

TEXT

= "..."

HEIGHT

= "22"

Width

= "35"

Type

= "Button"

>

ASP: Button

>

<

Div

id

= "Divcalendar"

>

<

ASP: PANEL

id

= "Panel1"

Runat

= "Server"

Width

= "172px"

HEIGHT

= "182px"

Visible

= "False"

>

<

ASP: Calendar

id

= "Calendar2"

Runat

= "Server"

Width

= "200px"

HEIGHT

= "180px"

OnsetChanged

= "Calendar1_SelectionChanged"

Borderwidth

= "2px"

Backcolor

= "White"

Forecolor

= "Black" font-size

= "8PT"

Font-names

= "Verdana"

Bordercolor

= "# 999999"

Borderstyle

= "Outset"

DaynaMeFormat

= "Firstletter"

Cellpadding

= "4"

>

<

TodaydayStyle

Forecolor

= "Black"

Backcolor

= "# Cccccc"

>

TodaydayStyle

>

<

Selectorstyle

Backcolor

= "# Cccccc"

>

Selectorstyle

>

<

NextprevStyle

VerticalAlign

= "Bottom"

>

NextprevStyle

>

<

DayHeaderstyle

Font-size

= "7PT"

Font-bold

= "True"

Backcolor

= "# Cccccc"

>

DayHeaderstyle

>

<

SelectedDaystyle

Font-bold

= "True"

Forecolor

= "White"

Backcolor

= "# 666666"

>

SelectedDaystyle

>

<

TitleStyle

Font-bold

= "True"

Bordercolor

= "Black"

Backcolor

= "# 999999"

>

TitleStyle

>

<

WEEKENDDAYSTYLELELELELELE

Backcolor

= "# Fffcc"

>

WEEKENDDAYSTYLELELELELELE

>

<

OtherMonthdayStyle

Forecolor

= "# 808080"

>

OtherMonthdayStyle

>

ASP: Calendar

>

ASP: PANEL

>

Div

>

Call page code:

转载请注明原文地址:https://www.9cbs.com/read-14580.html

New Post(0)