Calendar

Résolu
esisamimo Messages postés 6 Date d'inscription lundi 16 octobre 2006 Statut Membre Dernière intervention 19 août 2008 - 13 août 2008 à 16:39
esisamimo Messages postés 6 Date d'inscription lundi 16 octobre 2006 Statut Membre Dernière intervention 19 août 2008 - 15 août 2008 à 14:41
bsr
bon je developpe une petite application avec asp.net et j'ai dans une form un champs de saisie (textbox)pour y mettre une date
donc j ai proposer de mettre un button comme ca qd je clic desous je dois voir un calendar et apres la selection de la date le calendar disparaitera et j'ai pas su faire ca et je veux d'aide et merci de me repondre

merci

4 réponses

nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
13 août 2008 à 17:18
Salut

tu as Ajax toolkit calendar

Bon coding
3
nassar208 Messages postés 30 Date d'inscription mercredi 31 octobre 2007 Statut Membre Dernière intervention 17 juin 2009 1
13 août 2008 à 18:29
Bonjour,
comme Mr nhervagault a déja dit vous pouver utiliser le CalendarExtender de l'AjaxControlToolkit (www.codeplex.com),  et je pense que c'est le cas ou jamais d'utiliser les comportements Ajax dans tes applications web puisqu'il est le plus demandé dans le marché,

et effectivement tu peut trouver des DatePicker en css et jevascript sur le net.
Bonne journée
3
PascalCmoa Messages postés 239 Date d'inscription mercredi 19 février 2003 Statut Membre Dernière intervention 17 janvier 2013 5
14 août 2008 à 11:21
Voici un bout de code qui pourrai t'aider:

<%@ Page Language="VB" %>
<script runat="server">

    ' Insert page code here
    '

</script>
<html>
<head>
    <script language="Javascript">

    function GetDate(CtrlName)
    {
   /****************************************************
  
   Use Javascript method (window.open) to PopUp a new window
   which contain a Calendar Control. In the meantime, we'll
   pass the Parent Form Name and Request Control Name in the QueryString!
  
   *****************************************************/

        ChildWindow = window.open('Calendar.aspx?FormName=' + document.forms[0].name + '&CtrlName=' + CtrlName, "PopUpCalendar", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");
    }

   function CheckWindow()
   {
      ChildWindow.close();
   }

</script>
</head>

    <form runat="server">
        Start Date:
        [javascript:GetDate('txtStartDate') ]
       

        End Date:
        [javascript:GetDate('txtEndDate') ]
    </form>

</html>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

<%@ Page Language="VB" %>
<script runat="server">

    Public strFormName As String
    Public strCtrlName As String
    Public strSelectedDate As String
   
    Sub Page_Load(Sender As Object, E As EventArgs)
   
         If Not IsPostBack Then
   
             '-------------------------------------------------------------------
             ' Set the Calendar to Today's date in the first load
             '-------------------------------------------------------------------
   
             myCalendar.SelectedDate = System.DateTime.Now()
   
   
   
             '-------------------------------------------------------------------
             ' Set the DropDownList of Month and Year to Current Month and Year
             '-------------------------------------------------------------------
   
             ddlMonth.Items.FindByValue(DateTime.Now.Month).Selected = True
             ddlYear.Items.FindByValue(DateTime.Now.Year).Selected = True
   
         End If
   
         '-------------------------------------------------------------------
         ' Set the Selected Date to a temp String
         ' Set FormName and Control Name to 2 String from the values in QueryString
         '-------------------------------------------------------------------
   
         strSelectedDate = myCalendar.SelectedDate.ToString("dd/MM/yyyy")
         strFormName = Request.QueryString("FormName")
         strCtrlName = Request.QueryString("CtrlName")
   
    End Sub
   
         Sub myCalendar_SelectionChanged(sender As Object, e As EventArgs)
   
             '-------------------------------------------------------------------
             ' Change the Temp Selected Date Object if change is made
             '-------------------------------------------------------------------
   
             strSelectedDate = myCalendar.SelectedDate.ToString("dd/MM/yyyy")
   
         End Sub
   
   
         Sub ddl_SelectedIndexChanged(Sender As Object, e As EventArgs)
   
             '-------------------------------------------------------------------
             ' Change the VisibleDate of the Calendar according to
             ' the DropDownList dynamically
             '-------------------------------------------------------------------
   
             myCalendar.VisibleDate = New DateTime(CInt(ddlYear.SelectedItem.Value), CInt(ddlMonth.SelectedItem.Value), 1)
   
         End Sub

</script>
<html>
<head>
    <script language="Javascript">
    function ReturnDate()
        {

         window.opener.document.forms["<%= strFormName %>"].elements["<%= strCtrlName %>"].value = "<%= strSelectedDate %>";
         window.close();

        }
       
    function Close()
   
        {
            window.close();
        }
</script>
</head>

    <form runat="server">
                    ----

                                    Month:
                    [mailto:pascal.aknouche@free.fr email: PascalCmoa]
3
esisamimo Messages postés 6 Date d'inscription lundi 16 octobre 2006 Statut Membre Dernière intervention 19 août 2008
15 août 2008 à 14:41
MERCI MERCI MERCI BCBCBCBC JE NE SAIS PAS CE QUE JE PEUX VOUS DIRE TOUS MERCI BC

merci
3
Rejoignez-nous