简体   繁体   English

弹出日历看起来不正确

[英]The popup calendar does not look right

I'm trying to implement the AjaxControlToolkit (19.1.0) CalendarExtension control in a Webforms project.我正在尝试在 Webforms 项目中实现 AjaxControlToolkit (19.1.0) CalendarExtension 控件。 VS 2017.与 2017 年相比。

I have the toolkit referenced in a Master page, along with scriptmanager.我在母版页中引用了工具包以及脚本管理器。 My content page has scriptmanagerproxy reference.我的内容页面有 scriptmanagerproxy 参考。

The resultant display shows the current month on the top line, vertical column of day abbreviations on the left side, no day numbers for the month, and the current date on the bottom.结果显示在顶行显示当前月份,在左侧显示日期缩写的垂直列,该月没有日期编号,在底部显示当前日期。 So a square box with the Month at the top line, the current date 'Today:' on the bottom, and the left side with the day name abbreviation.所以是一个方形框,顶部是月份,底部是当前日期“今天:”,左侧是日期名称缩写。 Empty box otherwise.否则空盒子。

(I can't seem to get this formatted properly in this post textbox to post what it looks like) (我似乎无法在这个帖子文本框中正确格式化以发布它的样子)


| | < October, 2019 > | < 2019 年 10 月 > |

|Su | |苏 | |Mo | |钼 | |Tu | |涂 | |We | |我们 | |Th | |钍 | |Fr | |法国 | |Sa | |萨 | | | 29 | 29 | | | Today: October 23, 2019 |今天:2019 年 10 月 23 日 |

We are in the US, do not have any cultural settings set.我们在美国,没有设置任何文化背景。 On another page (not using a master page) it is looking ok (like a regular calendar).在另一个页面(不使用母版页)上看起来不错(就像一个常规日历)。

Is there a known issue with using this on a content page?在内容页面上使用它是否存在已知问题? Is there some setting, obscure or otherwise, that I am overlooking?是否有一些我忽略的设置,模糊或其他?

I've looked over a bunch of online articles on the control, but nothing mentioning anything like this.我查看了一堆关于控件的在线文章,但没有提到这样的事情。

My aspx code implementing it:我实现它的aspx代码:

…
<tr>
  <td>
    <asp:Label ID="Label6" runat="server" Text="Start Date"></asp:Label>
    <asp:TextBox ID="txtbxStartDate" runat="server" />
    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" TargetControlID="txtbxStartDate" runat="server" />
  </td>
</tr>
…

Solution: With the help of my designer, we figured out the issue was with the css stylesheet of the Master page overriding the 'td' and other css classes, and each element was therefore given a width: 100% value.解决方案:在我的设计师的帮助下,我们发现问题在于母版页的 css 样式表覆盖了“td”和其他 css 类,因此每个元素都被赋予了一个宽度:100% 的值。

By adding the following Style code into the webpage we resolved the issue.通过将以下样式代码添加到网页中,我们解决了该问题。

.ajax__calendar_container td {
    width: auto;
}

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

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