将ajax日历控件添加到asp.net中的文本框 [英] adding ajax calendar control to textbox in asp.net

查看:169
本文介绍了将ajax日历控件添加到asp.net中的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将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"/&gt;
            </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.

推荐答案

嗨...
看到这个,可能对你有用.
第一步: http://www.youtube.com/watch?v=24IgoIc0Ons [< ^ ]
第二步: Ajax日历控件 [
Hi...
see this,its may useful to u.
1st step:http://www.youtube.com/watch?v=24IgoIc0Ons[^]
In 2nd step: Ajax Calendar Control[^] do like this.
OR
Add ajax control toolkit.dll to ur project reference folder.then write blow code in .aspx.
<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.


您好Sharma,
请检查本文对Ajax日历控件的描述.
我认为这会有所帮助..
http://androidsharp.blogspot.in/2013/06/custom- calender-control-in-aspnet-web.html [ ^ ]
Hi Sharma,
Please check this article its describing about Ajax Calender Control..
I think it will be helpful..
http://androidsharp.blogspot.in/2013/06/custom-calender-control-in-aspnet-web.html[^]


而不是尝试以下这篇文章:

Ajax日历控件 [
Instead of that try this following article:

Ajax Calendar Control[^]


这篇关于将ajax日历控件添加到asp.net中的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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