hi,

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..!

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.