← Tutti gli articoli

ASP.NET AJAX Control Toolkit - Calendar Extender - EnableScriptGlobalization

23 March 2011  ·  Asp.Net · Article  ·  946 visite

The ASP.NET AJAX Control Toolkit includes an amazing number of controls. The calendar extender it's usefull because the format date for each country it's different from each other.

In our aspx page we insert:
  • the Asp.Net ScriptManager (with EnableScriptGlobalization set to true)
  • a texbox (TextBox1)
  • a CalendarExtender (associated to our textbox)
    1. <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true">  
    2.        </asp:ScriptManager>  
    3.   
    4.        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>  
    5.          
    6.        <asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"   
    7.            Enabled="True" TargetControlID="TextBox1">  
    8.        </asp:CalendarExtender>  
To be sure the date format it's in the correct country format we have to insert a globalization tag in the System.Web section of the Web.Config:
 
  1. < system.web >   
  2.    <!--// Web.config section under system.web-->  
  3.   
  4.    <globalization culture="it-IT" uiCulture="it" />  
 
Si è verificato un errore imprevisto. Ricarica

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.