日历控件出现问题 [英] Problem with the calendar control

查看:112
本文介绍了日历控件出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我面临日历控制的问题.我想在日历Cantrol中将选择的日期显示给我使用此代码的文本框

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

txbDateofJoining.Text = CalendarDateofJoining.SelectedDate.ToString();

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


值也插入数据库中,但我面临两个问题,例如

1).在日历控件中选择的日期保存在数据库中,但未显示在文本框中.

2).当我想选择当前月份或年份之前的日期时,单击一下即可重新加载日历控件.

3).在Visual Studio 2008中,我采用了一个向导控件,其中所选日期没有显示在文本框中,而在vs2010中,我直接在页面上对其进行了测试,然后显示了所选日期,但是每次单击后都会重新加载最后一次单击和日历控件例如,如果我在第一次单击中选择了2012年7月25日,然后在第二次单击中再次选择了日期7月26日,则在文本框中显示的日期是2012年7月25日.

请帮助我解决此问题.


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

推荐答案

1-您是否设置了断点以查看发生了什么?您的数据库代码在哪里?如果您使用存储在数据库中的相同代码设置文本,从而知道该值是正确的怎么办?您是否在其他任何地方设置了txtbox文本?

2-第二个问题没有道理.您正在使用什么日历控件,这是什么问题?

3-最终点击问题可能意味着您正在设置页面加载中的值,因此在事件中它们会被更改,然后触发.在prerender事件中设置文本.
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.


这篇关于日历控件出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆