从做回发,每次月份改变停在ASP日历控件,网 [英] stop the calendar control in asp,net from doing a postback everytime the month is changed

查看:102
本文介绍了从做回发,每次月份改变停在ASP日历控件,网的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net日历控件有一个默认的行为做了回发每当月被改变(下次点击时或previous月箭头)。这会导致日历控件崩溃。如何prevent这一点。我想要回发,只有当日期选择的变化,当一个月更改日历控件应该不会崩溃。

The Calendar control in asp.net has a default behaviour to do a postback whenever the month is changed (when clicking on next or previous month arrows). This causes the calendar control to collapse. How to prevent this. I want a postback only when the date selection changes and the calendar control should not collapse when month is changed.

任何帮助是pciated AP $ P $

Any help is appreciated

在此先感谢

推荐答案

这听起来像有你的页面上的其他一些code未回发意识到,导致日历控件崩溃。日历控件是一个服务器端控件,这将导致回发改月,年等。

It sounds like there is some other code on your page that is not postback aware that is causing the calendar control to collapse. The calendar control is a serverside control that will cause postbacks to change the month, year, etc.

一件事,试图将是把在一个AJAX的UpdatePanel日历控件。仍然会发生后回来,但它会出现在面板的环境中才能完成,而不应解雇所有回程其他页面事件。

One thing to try would be to put the calendar control on an ajax updatepanel. The post back will still occur, but it will be done within the context of the panel and should not fire all the other page events on the return trip.

我也同意Tim的建议,你可以使用一个客户端的日期选择器。如果您未在控制做任何事情的code有趣的后面,它不加入任何价值。

I also agree with Tim's advice that you could use a client side date picker. If you are not doing anything interesting on the code behind with the control, it's not adding any value.

这篇关于从做回发,每次月份改变停在ASP日历控件,网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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