AjaxControlToolkit.CalendarExtender 数据绑定能力
AjaxControlToolkit.CalendarExtender 控件是否可绑定?
在我的 eWorld.CalendarPopup 中,您使用数据库来设置假期,并且有许多图形属性。在我看来:
- CalendarToolkit 无法将自己链接到某个充满假期的数据库,
- 格式化日历外观的唯一方法是通过 CSS。
(1) 这些假设正确吗?因此 CalendarExtender 是否被视为有限控件?
(2) 我负责渲染事件处理程序中的样式,如下所示:
writer.Write(@"<Style type='text/css'>
.ajax__calendar_container
{
padding: 0px 0px 0px 0px;
}
.ajax__calendar_header, .ajax__calendar_footer
{
font-size: " + (CalendarFontSize.IsEmpty ? "8pt" : CalendarFontSize.ToString()) + @";
font-family: " + (string.IsNullOrEmpty(CalendarFontName) ? "Verdana" : CalendarFontName) + @";
font-weight: bold;
background-color: #dcdcdc;
border-width: 0px;
}
//...
//...
</Style>"
);
base.Render(writer);
IS the AjaxControlToolkit.CalendarExtender control bindable?
In my eWorld.CalendarPopup you use the database to set holidays, and there are numerous graphical properties. It seems to me that:
- the CalendarToolkit has no method to link itself to some database full of holidays
- the only way to format the look at feel of the calendar is via CSS.
(1) Are these assumptions correct? Is the CalendarExtender thus considered a limited control?
(2) I take care of styling in the Render event handler, as in:
writer.Write(@"<Style type='text/css'>
.ajax__calendar_container
{
padding: 0px 0px 0px 0px;
}
.ajax__calendar_header, .ajax__calendar_footer
{
font-size: " + (CalendarFontSize.IsEmpty ? "8pt" : CalendarFontSize.ToString()) + @";
font-family: " + (string.IsNullOrEmpty(CalendarFontName) ? "Verdana" : CalendarFontName) + @";
font-weight: bold;
background-color: #dcdcdc;
border-width: 0px;
}
//...
//...
</Style>"
);
base.Render(writer);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要回答您的第一个问题... AjaxControlToolkit.CalendarExtender 不可绑定,但是,它扩展的控件可以。例如,如果将 AjaxControlToolkit.CalendarExtender 添加到 TextBox 控件,则可以将该文本框绑定到某个数据库中的值。
AjaxControlToolkit.CalendarExtender 只执行其设计目的...通过显示用户可以选择日期的日历控件来扩展现有控件。然而,它不是日历控件......
To answer your first question... the AjaxControlToolkit.CalendarExtender is not bindable, however, the control that it is extending can be. For example, if you add the AjaxControlToolkit.CalendarExtender to a TextBox control, you can bind the text box to a value in some database.
The AjaxControlToolkit.CalendarExtender only does what it was designed to do... extend existing controls by showing a calendar control where users can pick a date. However, it is not a calendar control...