Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to validate if date is a weekday or weekend c#

DayOfWeek today = DateTime.Today.DayOfWeek;
if (today == DayOfWeek.Sunday || today == DayOfWeek.Saturday)
{
  ClientScript.RegisterStartupScript(GetType(), "alert", "alert('" weekend"');", true);
}
else
{
    ClientScript.RegisterStartupScript(GetType(), "alert", "alert('" weekday"');", true);
}
Source by social.msdn.microsoft.com #
 
PREVIOUS NEXT
Tagged: #validate #date #weekday #weekend
ADD COMMENT
Topic
Name
8+7 =