简体   繁体   English

从 ASP.NET 日历控件的单元格触发事件

[英]Firing an event from an ASP.NET calendar control's cell

I'm building an Events Calendar using the ASP.NET/C# framework.我正在使用 ASP.NET/C# 框架构建一个事件日历。 I'm able to display the summary of events in the respective days cells by data binding manually in the OnDayRender event handler.我可以通过在OnDayRender事件处理程序中手动绑定数据来显示相应日期单元格中的事件摘要。 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. ASP.NET 提供的日历控件不允许将动态控件(可以触发事件)放置在单元格内,因此任何链接按钮都没有问题。 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.谷歌搜索后,我决定以编程方式在每个单元格中添加代表摘要的超链接,并添加一个 javascript function 作为超链接OnClick事件处理程序。 The javascript function accepts the event details and displays them inside an alert box as of now. javascript function 接受事件详细信息并将其显示在警报框中。

I need a lot more functionality inside the pop up box displaying the event details (RSVP, Remind Me etc).在显示事件详细信息(RSVP、提醒我等)的弹出框中,我需要更多功能。 Ideally I don't want to go the Javascript route since I don't know it too well.理想情况下,我不想 go Javascript 路线,因为我不太了解它。 I am more comfortable with C/C++ and C#.我更喜欢 C/C++ 和 C#。

Can someone please give me general pointers on how to proceed with/without javascript?有人可以给我关于如何使用/不使用 javascript 的一般指示吗?

How are the event calendars using the ASP.NET framework able to display event firing controls inside the traditional calendar control's cell?使用 ASP.NET 框架的事件日历如何能够在传统日历控件的单元格内显示事件触发控件? The MSDN library clearly says one can't do that, and I tried and failed, as expected. MSDN 库明确表示无法做到这一点,我尝试并失败了,正如预期的那样。

According to my experience, System.Web.UI.WebControls.Calendar is not a particularly nice piece of code, especially when you try to customize it.根据我的经验,System.Web.UI.WebControls.Calendar 并不是一段特别好的代码,尤其是当您尝试自定义它时。

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 http://www.daypilot.org/daypilot-lite.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM