问题描述
我想将Ajax日历控件附加到文本框.我所做的如下:
添加了一个文本框,并将日历pi附加到该文本框.我想要的是用户单击图像时自动以mm/dd/yyyy格式显示的日历弹出窗口.我已经下载了AjaxControlToolkit并将其引用添加到我的项目中(.dd到我的wesite bin文件夹中).
这就是我对.aspx中的文本框所做的操作:
I want to attach a Ajax calendar control to a textbox. what i have done is as follows:
Added a textbox and attach a calendar pi at textbox. what i want is when user clicks on image automatically calendar popup with format of mm/dd/yyyy. I have downloaded AjaxControlToolkit and added its reference to my project.(.dd to my wesite bin folder).
this is what i have done with my textbox in .aspx:
<asp:TextBox ID="TextBox2" AutoPostBack="true" onblur="calAge()" runat="server"></asp:TextBox>
<asp:Image ID="img" runat="server"
ImageUrl="~/stock-vector-post-it-calendar-113843446.jpg" Height="16px"
Width="16px" />
<asp:CalendarExtender ID="TextBox2_CalendarExtender" runat="server"
Enabled="True" TargetControlID="TextBox2">
</asp:CalendarExtender>
在我的webconfig文件中:
in my webconfig file:
<pages>
<controls>
<add tagprefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add tagprefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit">
tagPrefix="ajaxToolkit"/>
</add></controls>
</pages>
当我调试我的项目时,它显示以下错误:
当前位置没有可用的源代码.
单击确定时显示错误:
找不到适合指定文化或中立文化的任何资源.确保在编译时已将"AjaxControlToolkit.Properties.Resources.resources"正确嵌入或链接到程序集"AjaxControlToolkit"中,或者确保所需的所有附属程序集都可加载并经过完全签名.
为什么这样?在我的网站名称空间中,我还添加了使用AjaxControlToolkit的功能; .什么地方出了错?在此先感谢.
when i debug my project it shows following error:
There is no source code available for the current location.
on clicking ok shows the error:
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "AjaxControlToolkit.Properties.Resources.resources" was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Why so? in my website namespace also i have added the using AjaxControlToolkit; . what went wrong? thanks in advance.
推荐答案
<asp:textbox id="txtajax" runat="server" cssclass="txtajax" xmlns:asp="#unknown"></asp:textbox>
<asp:image id="img1" runat="server" height="21px" imageurl="~/Koala.jpg" xmlns:asp="#unknown">
Width="35px" />
<asp:toolkitscriptmanager id="tksm" runat="server"></asp:toolkitscriptmanager>
<asp:calendarextender id="txtajax_CalendarExtender" runat="server" popupposition="Right" format="MM-yyyy" onclientshown="ChangeCalendarView" targetcontrolid="txtajax" popupbuttonid="img1"></asp:calendarextender>
</asp:image>
谢谢你.
Thank u.
这篇关于将ajax日历控件添加到asp.net中的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!