开发者

How to make ASP.NET AJAX CalendarExtender always visible?

I开发者_如何学Go'd like to be able to have the .NET AJAX CalendarExtender show on Load without having to click in a TextBox. If I can simulate a TextBox being clicked so the CalendarExtender will show I'll take that too.


The CalendarExtender does not support it. You could write your own, but it would be much simpler to just use a standard Calendar control if you want a calendar that's always visible.

The extender was meant for use with a textbox when you want the calendar to pop up as needed. Why write a new control when the basic control already exists?

Edit

To address the point in the comment about needing to switch years easily. I COMPELTELY understand. This is a frustration for me as well. however, there are several ways to overcome this. One good example can be found here: https://web.archive.org/web/20210304123649/https://www.4guysfromrolla.com/articles/090104-1.aspx


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />


  <asp:TextBox runat="server" ID="txtboxFilter" ClientIDMode="Static" />
  <ajaxToolkit:CalendarExtender runat="server" TargetControlID="txtboxFilter" />


    <script type="text/javascript">
      document.getElementById('txtboxFilter').focus();
    </script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜