W3Schools.com

ASP.NET IsWeekend Property


CalendarDay Control Reference Complete CalendarDay Control Reference

Definition and Usage

The IsWeekend property is used to get whether or not the date is a Saturday or Sunday.

This property returns "TRUE" if the date is in a weekend.


Example

The following example shows if the selected day is in a weekend or not:

<script runat="server">
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
  If e.Day.IsSelected Then
    If e.Day.IsWeekend = "TRUE" Then
      Label1.Text = "YES"
    Else
      Label1.Text = "NO"
    End If
  End If
End Sub
</script>

<form runat="server">
  <asp:Calendar id="cal1" runat="server"
  OnDayRender="DaySelect"/>
  The selected date is in a weekend:
  <asp:Label id="Label1" runat="server"/>
</form>

Show example »

CalendarDay Control Reference Complete CalendarDay Control Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE