ASP study notes 2

xiaoxiao2021-03-17  194

MultiveW controls can display multiple view controls, put multiple View controls in the MultiView control when using, and then select what control to the user through the MultiView control.

The Calendar control can display the date and can be customized, the code is as follows

Partial Class democelander Inherits System.Web.UI.Page Private holidays (12, 31) As String Protected Sub DropDownList1_SelectedIndexChanged (ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged Select Case Me.DropDownList1.SelectedValue Case "week "Me.Calendar1.SelectionMode = CalendarSelectionMode.DayWeek Case" day "Me.Calendar1.SelectionMode = CalendarSelectionMode.Day Case" dayweekmonth "Me.Calendar1.SelectionMode = CalendarSelectionMode.DayWeekMonth Case" none "Me.Calendar1.SelectionMode = CalendarSelectionMode.None End SELECT END SUB

Protected Sub Page_Load (Byval e as system.eventargs) Handles Me.Load Holidays (3, 15) = "Tanabata Valentine's Day" End Sub

Protected Sub Calendar1_dayrender (Byval e as system.web.ui.webcontrols.dayrendreventargs) Handles Calendar1.dayrender Dim D AS Calendarday Dim C As TableCell

D = E.day c = E.Cell

If D.isothermonth Ten C.Controls.clear () else try Dim Hol as string = holidays (d.date.month, d.date.day)

IF HOL <> "" THEN C.Controls.add (New LitralControl ("
" HOL)) End if catch exce () (Exc.tostring ()) End Try End If End Subend Class

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

New Post(0)