Get Calendar's Selected Date by Javascript

To Get selected value of Calendar Control thru JavaScript, the following steps will be helpful

Declare Date time Variable at server side like


public DateTime dt = DateTime.Now;


Assign th value of this variable at serverside on Calendar1_SelectionChanged Event

  
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
dt = Calendar1.SelectedDate;
}


You can access the Selected Date by Javascript


function GetValue()
{
alert('<%=dt %>');
}


Comments

Author: Gaurav Aroraa30 Jan 2009 Member Level: Gold   Points : 0

Hi,

Really good one!

Keep posting the resources.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: