Click here to Skip to main content
15,916,462 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi All,

I am facing a problem with calendar control. I want to show the date selected in calendar cantrol to the textbox for that i have used this code
C#
txbDateofJoining.Text = CalendarDateofJoining.SelectedDate.ToString();

txbDateofBirth.Text = CalendarDateofBirth.SelectedDate.ToString();

and the value is inserted in the database as well but i am facing two problems like

1). The date selected in the calendar control save in database but not displayed in the textbox.

2). When i want to select the date before the current month or year the calendar control reload after a single click.

3). In visual studio 2008 i have taken a wizard control in that the selected date in not showing in the textbox and in vs2010 i have tested it direct on the page then it displays the date selected but of last click and calendar control reloads after each click on it for example if i selected 25 july 2012 in the first click and again select the date 26 july in the second click then in the textbox the date displayed is the 25 july 2012.

Please help me to resolve this problem.

Any help will be appreciated
Posted
Updated 27-Jul-12 22:31pm
v2

1 solution

1 - have you set breakpoints to see what is happening ? Where is your DB code ? What if you set the text in the same code that stores in the DB, so you know the value is correct ? Do you set the txtbox text anywhere else ?

2 - This second question makes no sense. What calendar control are you using, and what is the issue ?

3 - The last click issue probably means you're setting values in page load, and so they get changed in the event, which fires after. Set your text in the prerender event.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900