从 ASP.NET 日历控件的单元格触发事件
我正在使用 ASP.NET/C# 框架构建事件日历。 我可以通过在 OnDayRender
事件处理程序中手动进行数据绑定来显示相应日期单元格中的事件摘要。 客户端需要能够单击单元格内的事件以查看弹出框中的详细信息。
ASP.NET 提供的日历控件不允许将动态控件(可以触发事件)放置在单元格内,因此任何链接按钮都是不可能的。 经过谷歌搜索后,我决定以编程方式在每个表示摘要的单元格内添加超链接,并添加一个 javascript 函数作为超链接 OnClick
事件处理程序。 到目前为止,javascript 函数接受事件详细信息并将其显示在警报框中。
我需要在显示事件详细信息的弹出框中提供更多功能(RSVP、提醒我等)。 理想情况下,我不想走 Javascript 路线,因为我不太了解它。 我对 C/C++ 和 C# 更熟悉。
有人可以给我关于如何使用/不使用 javascript 进行操作的一般指示吗?
使用 ASP.NET 框架的事件日历如何能够在传统日历控件的单元格内显示事件触发控件? MSDN 库明确表示不能这样做,正如预期的那样,我尝试了但失败了。
I'm building an Events Calendar using the ASP.NET/C# framework. I'm able to display the summary of events in the respective days cells by data binding manually in the OnDayRender
event handler. The clients need the ability to click on the events inside the cells to see the details inside a pop up box.
The calendar control provided by ASP.NET does not allow dynamic controls (which can fire events) to be placed inside the cells, so any link button is out of question. After googling, I decided to programmatically add hyperlinks inside each cell which represented the summary and added a javascript function as the hyperlinks OnClick
event handler. The javascript function accepts the event details and displays them inside an alert box as of now.
I need a lot more functionality inside the pop up box displaying the event details (RSVP, Remind Me etc). Ideally I don't want to go the Javascript route since I don't know it too well. I am more comfortable with C/C++ and C#.
Can someone please give me general pointers on how to proceed with/without javascript ?
How are the event calendars using the ASP.NET framework able to display event firing controls inside the traditional calendar control's cell ? The MSDN library clearly says one can't do that, and I tried and failed, as expected.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我的经验,System.Web.UI.WebControls.Calendar 并不是一段特别好的代码,尤其是当您尝试自定义它时。
我建议您尝试一些可用的日历/日程安排控制套件。 您可以从这个(开源)开始:
http://www.daypilot.org/ daypilot-lite.html
According to my experience, System.Web.UI.WebControls.Calendar is not a particularly nice piece of code, especially when you try to customize it.
I suggest you try some of the calendar/scheduling control suites available. You can start with this one (open-source):
http://www.daypilot.org/daypilot-lite.html