开发者

Get selected date from calendarextender

开发者 https://www.devze.com 2022-12-30 20:05 出处:网络
I have a textbox extended with the calendar extender in ASP.NET Ajax. If I get the selected date of the calendar, the variable is null, and the text of the textbox always defaults to the value I speci

I have a textbox extended with the calendar extender in ASP.NET Ajax. If I get the selected date of the calendar, the variable is null, and the text of the textbox always defaults to the value I specified (Default) for when the page loads.

How can I get the selecte开发者_如何学编程d date when I change it? I need this for the button click event handler.

Thanks


The calendar extender has a selectedDate() property on the client-side API, and a dateSelectionChanged event if you need immediate notification; you can get the selected date via:

var date = $find("<%= cal1").get_selectedDate();

which should be not null; I looked in the JS and it is setting it when clicking on the day.

HTH.

0

精彩评论

暂无评论...
验证码 换一张
取 消