I m getting from date and to date when i click the image button in my web form (asp.net 2005 with c#).After selecting the date the calendar should hide and the selected date only shoud appear in my text box..

protected void ImageButton4_Click(object sender, ImageClickEventArgs e)
        Calendar1.Visible = true;
       txt_from.Text = Calendar1.SelectedDate.ToShortDateString();

i have given like this ...but before selecting the date it shows default date and when i try to change the date its not changing?

and one more thing ...without javascript in asp.net itself can i create desired size web page.. bec i thought to put calendar in a new aspx page and after selecting tat it should be invisible...

help me for this also..!

9 Years
Discussion Span
Last Post by zAndrew

The event you want to register a method with would be SelectionChanged:

protected void calendar_SelectionChanged(object sender, EventArgs e)
   someControl.SelectedValue = calendar.SelectedDate.Day.ToString();
   calendar.Visible = false;
   calButton.Visible = true;

Hope this helps.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.