Calendar Control: How to disable hyperlink for a date and how to remove dates from other months

Posted on 2004-04-22
Last Modified: 2008-02-26
I have a calendar control in which I want to disable hyperlink on few dates based on some values and also I dont want the dates from other months to be displayed.

Can someone help me with this??

Question by:jackrock79
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 28

Accepted Solution

mmarinov earned 250 total points
ID: 10893396
you can use this
private void Calendar1_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
      if ( e.Day.Date.Month != DateTime.Now.Month )
          e.Cell.Text = ""; //clears the cell's
      if ( e.Day.Date.Day == 5 )
          e.Day.IsSelectable = false;


Author Comment

ID: 10893763
Thanks for the code
LVL 28

Expert Comment

ID: 10894057
Hi jackrock79, why Grade B - isn't this code what you are looking for ?


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asp Google Map 2 93
Code works but breaks when I add one section 4 35
history of pages 7 54
Why am I losing my session variable value 11 40
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question