Hello
We are using asp:Calendar control (month view) in our touch screen application (asp web forms). When user touches the day on the month, it fires the on click event. The issue that was brought up, that user has to press exactly on the number, or the click event
won't fire up. My boss wants us to change it, that if user presses anywhere in the date cell, it should fire the event. I looked into adding the button or link or hidden field into the cell on rendering (script), but have not found a way to attach click event...
Is there any way to accomplish it? If not - is there any other control that would show the whole month and be customizable?
Thanks!
looked into adding the button or link or hidden field into the cell on rendering (script), but have not found a way to attach click event...
Please try to use OnDayRender event to create an onclick event on calendar date cell.
And use the onclick event to call a js function.
Then in the js function fire button click event.
For example:
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
9 Points
94 Posts
Customizing Calendar control
Mar 03, 2017 03:35 PM|asanders2552|LINK
Hello
We are using asp:Calendar control (month view) in our touch screen application (asp web forms). When user touches the day on the month, it fires the on click event. The issue that was brought up, that user has to press exactly on the number, or the click event won't fire up. My boss wants us to change it, that if user presses anywhere in the date cell, it should fire the event. I looked into adding the button or link or hidden field into the cell on rendering (script), but have not found a way to attach click event... Is there any way to accomplish it? If not - is there any other control that would show the whole month and be customizable?
Thanks!
All-Star
45489 Points
7008 Posts
Microsoft
Re: Customizing Calendar control
Mar 06, 2017 08:22 AM|Zhi Lv - MSFT|LINK
Hi asanders2552,
Please try to use OnDayRender event to create an onclick event on calendar date cell.
And use the onclick event to call a js function.
Then in the js function fire button click event.
For example:
In aspx:
Code behind:
Best regards,
Dillion