.NET日历 - 使整个单元格执行回发(可点击)单元格、日历、NET

2023-09-06 09:54:47 作者:倾城雨落笙箫陌

我已经有了一个.NET日历和运行,从数据库带来的信息。默认情况下,天数有一个回行动适用于它。

我想要做的是有行动适用于整个单元,因此用户不需要点击只是文字链接。

我是dayRenderer动作我有以下行,试图复制我不知道如何设置的动作,但第二个参数。

这似乎给它一个ID例如3315,但我不知道如何手动获得所需的ID,此code以下。我希望这是有道理的!我是新来的.NET所以不是很精明的术语来!

  e.Cell.Attributes.Add(onclick事件,
    的String.Format(JavaScript的:__ doPostBack({0},{1}),
    Calendar1.ClientID,*** *** ID_NEEDED_HERE));
 

解决方案

参数是天自2000年1月1日的数字为您的日历,通过一个Vpceded $ P $的第一天。

所以,'V0'的ID是指2000年1月1日,V5的ID是指2000年1月6日,对V-5是指1999年12月27日一个ID。

干杯,

鲁本

I've got a .net calendar up and running and bringing information from a database. By default the day number has a post back action applied to it.

excel里面是否可以实现这个功能吗 即插入日历,然后通过点击日历上的日期,使得日期自动填入指定单元格

What I'm trying to do is have that action apply to the whole cell so the user doesn't need to click on just the text link.

I'm the dayRenderer action i have the following line to try and replicate the action but the second argument I'm not sure how to set it.

It appears to give it an id e.g. 3315 but I'm not sure how to get the required id manually for this code below. I hope this makes sense! I'm new to .NET so not very savvy with my terminology!

e.Cell.Attributes.Add("OnClick", 
    string.Format("javascript:__doPostBack('{0}','{1}')", 
    Calendar1.ClientID, ***ID_NEEDED_HERE***));

解决方案

The parameter is the number of days since Jan 1 2000 for the first day of your calendar, preceded by a 'V'.

So an ID of 'V0' means Jan 1 2000, an ID of 'V5' means Jan 6 2000, an ID of 'V-5' means Dec 27, 1999.

Cheers,

Ruben