AJAX日历扩展器和文本框 [英] AJAX calender extender and textbox

查看:57
本文介绍了AJAX日历扩展器和文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问是否有必要使用ajax日历扩展器来包括更新面板?我想在单击文本框时显示日历.我已经尝试包括更新面板,但是它不起作用

i want to ask it is necessary to include update panel in order using ajax calender extender? i want to display calender when click the text box .I have try to including update panel, but it does not work

推荐答案

If you want to popup a Calendar on the click of a button, you can use set the PopupButtonID of the CalendarExtender to the ID of the button. In this case, we will be using an ImageButton as shown below:
       <asp:ImageButton runat="Server" ID="ImageButton1" ImageUrl="~/Images/Icon1.jpg" AlternateText="Click here to display calendar" />
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

        <cc1:CalendarExtender ID="CalendarExtender1" runat="server"

        TargetControlID="TextBox1" PopupButtonID="ImageButton1"/>
If you are using an earlier version of the toolkit, you may observe that the ImageButton causes a postback when you click on it again, to close the Calendar. To avoid the postback, use a HTML Image Control instead of the Server side Image Control as shown below:
       <img alt="Icon" src="/Images/Icon1.jpg" id="Image1" />
       <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

        <cc1:CalendarExtender ID="CalendarExtender1" runat="server"

        TargetControlID="TextBox1" PopupButtonID="Image1"/>
Note: In case you are clicking on the textbox to open the calendar, then in earlier versions of the toolkit, the calendar would not hide automatically when the user clicked anywhere outside the Calendar control. However this was fixed in the later versions. In fact, in the latest version, the Calendar hides automatically when a date is selected.
If for some reason you are facing issues with the Calendar not hiding automatically, make sure that you have the latest version of the AJAX Control Toolkit.


我也遇到了同样的问题...,但是我最终找到了解决方案,希望它对asp.net Ajax扩展器控件,工具包也可以扩展Asp.Net Ajax脚本管理器(称为ToolkitScriptManager)有所帮助.尝试替换< asp:scriptmanager xmlns:asp =#unknown">与< asp:toolkitscriptmanager>一起使用,这应该可以解决您面临的问题.
I had the same issue too..., but i found solution eventually, hopefully this will be helpful, along with the asp.net Ajax extender controls, toolkit also extended Asp.Net Ajax script manager, which is called ToolkitScriptManager. Try replace <asp:scriptmanager xmlns:asp="#unknown"> with <asp:toolkitscriptmanager>, this should fix the issue you are facing.


无需将其放在更新面板中,因为更新面板仅用于加载所需页面或您想要更新的功能页面,只需添加工具包脚本管理器,Calendorextendor文本框和(单击将显示日历的图像)

试试这个链接

链接[ ^ ]
There is no need to put that in update panel because update panel is used to loads only that part of the page which is required or you want to update what you can do is just add Toolkit script manager,Calendorextendor textbox and (Image on the click of which calendor will be displayd )

try this link

Link [^]


这篇关于AJAX日历扩展器和文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆