Claendar COntrol
in calendar if user choose day sunday i want pop up message today is sunday choose another day. with example
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Feb 24, 2012, 10:26 PM
Thanks
Satyapriya NayakPosted Feb 21, 2012, 11:53 AM
Try this...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Calender11._Default" %>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Drawing;
namespace Calender11
{
public partial class _Default : System.Web.UI.Page
{
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date.ToLongDateString().Contains("Sunday"))
{
e.Cell.Attributes.Add("onclick", "javascript:alert('Today is sunday choose another day')");
e.Cell.ForeColor = Color.Red;
}
}
}
}
Thanks
If this post helps you mark it as answer