tags:

views:

274

answers:

1
<asp:ScriptManager runat="server" ID="ScriptManager" />
<asp:TextBox runat="server" ID="TextBox1"></asp:TextBox>
<asp:CalendarExtender runat="server" ID="MyCalendar" TargetControlID="TextBox1" />

but it doesn't works = I can't see Calendar on click. How to realize it : AJAX Calendar

Added mask. Doesn't works too.

code :

<asp:ScriptManager runat="server" ID="ScriptManager" >
</asp:ScriptManager>

<asp:TextBox runat="server" ID="TextBox3"/>
<asp:MaskedEditExtender ID="TextBox3_MaskedEditExtender" runat="server" 
     Mask="__/__/____" MaskType="Date" TargetControlID="TextBox3">
</asp:MaskedEditExtender>
<asp:CalendarExtender runat="server" ID="MyCalendar" TargetControlID="TextBox3"
     ScriptPath="" />

On run script :

<script type="text/javascript">
1
2//<![CDATA[     3Sys.WebForms.PageRequestManager._initialize('ctl00$ContentPlaceHolder1$ScriptManager', document.getElementById('aspnetForm'));
4Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);
5 //]]>
</script>
<input id="ctl00_ContentPlaceHolder1_TextBox3" type="text" value="21.01.2010" name="ctl00$ContentPlaceHolder1$TextBox3"/>
<input id="ctl00_ContentPlaceHolder1_TextBox3_MaskedEditExtender_ClientState" type="hidden" name="ctl00$ContentPlaceHolder1$TextBox3_MaskedEditExtender_ClientState"/>

Thank you.

+1  A: 

I have on that's implemented by clicking a button to get the calendar to pop up. It uses the following code

<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" CssClass="MyCalendar"
    Format="dd/MM/yy" PopupButtonID="btnStartDate" TargetControlID="txtStartDate">

EDIT I've just found another sample which does it on clicking in the text box.

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"&gt;
<configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
            <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
            <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
                <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
            </sectionGroup>
        </sectionGroup>
    </sectionGroup>
</configSections>
<system.web>
    <httpHandlers>
        <remove path="*.asmx" verb="*"/>
        <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
    </httpHandlers>
    <compilation debug="true">
        <assemblies>
            <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add assembly="UserCredentialsClient, Version=1.0.0.3, Culture=neutral, PublicKeyToken=E17434B22921A736"/>
            <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
        <buildProviders>
            <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
        </buildProviders>
    </compilation>
</system.web>
<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
        <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </modules>
    <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </handlers>
</system.webServer>

Dave7896
hmm... Unable to find resources that match the specified culture or the neutral culture. Check the introduction or binding "AjaxControlToolkit.Properties.Resources.resources" to build "AjaxControlToolkit" at compile time, or make sure that all the necessary associated building is fully signed and can be downloaded.maybe I need to add some more instead dll only ?
nCdy
See the above edit
Dave7896
Do you have the AJAX assemblies registered in your web.config file?no :) how ?
nCdy
Also, make sure the AjaxControlToolkit.dll is in your bin folder
Dave7896
haha sorry. it got truncated. i've added it again but stripped out all the other rubbish :-)
Dave7896
eeeh... I've got dlls in my bin folder , but what exactly I must to add in web.config ... I didn't even found ajax word in yours.
nCdy
I think it's the stuff in the handlers section at the bottom that needs to be there, but I'm not 100% certain on that.
Dave7896
I'll try to google :-/
nCdy