Bonjour,

Quand je clique sur une date du calendrier la liste des congrès s'affiche. Jusqu'ici aucun souci.

Mais si je décide d'effectuer une nouvelle recherche en changeant le mois et l'année, là je rencontre un problème.

Dès que je change le mois ou l'année la page se recharge automatiquement, et du coût ma réponse.write s'affiche. Donc on peut supposer qu'il n'y a pas de congrès, hors ces faux. Car si on clique sur une date, la liste des congrès apparaît.

Y a t'il un moyen pour éviter ça....

Voici mon code du calendrier

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
 
<% 
' --------------------------------------------------------------------------------------------
' ---------------------------- Debut Fonction----------------------------------------------
' --------------------------------------------------------------------------------------------
 
      function nom_mois (mois)
         select case mois
            case "1"
               nom_mois = "Janvier"
            case "2"
               nom_mois = "Février"
            case "3"
               nom_mois = "Mars"
            case "4"
               nom_mois = "Avril"
            case "5"
               nom_mois = "Mai"
            case "6"
               nom_mois = "Juin"
            case "7"
               nom_mois = "Juillet"
            case "8"
               nom_mois = "Août"
            case "9"
               nom_mois = "Septembre"
            case "10"
               nom_mois = "Octobre"
            case "11"
               nom_mois = "Novembre"
            case "12"
               nom_mois = "Décembre"
         end select
      end function
 
 
' -------------------------------------------------------------------------------------------
' ---------------------------- Fin Fonction ------------------------------------------------
' -------------------------------------------------------------------------------------------
 
      D=date() 
 
' --- récupération du mois recherché --- '
 
      mois = request.querystring("mois")
 
      if mois = "" then 
         D=date() 
      else
         an=year(D)
         D=dateserial(an,mois,1)
      end if
 
' --- récupération de l'année recherchée --- '
 
      an = request.querystring("an")
 
      if an = "" then 
         D=date() 
      else
         mois=month(D)
         D=dateserial(an,mois,1)
      end if
 
' --- création de mes variables ---'
 
      an=year(D)
      jour=day(D)
      mois=month(D)
      jour_semaine=weekdayname(weekday(D))
 
' --- gestion des années pour la liste de choix ---'
 
      ann_rep = year(Date())
      an_deb = ann_rep - 0
      an_fin = ann_rep + 4
 
' --- nombre de jours dans le mois actuel --- '
 
      D1 = dateserial(an,mois,1)
      jour_mois=weekdayname(weekday(D1))
      D2 = dateserial(an,mois + 1,1)
      jours_mois = datediff("d",D1,D2)
 
' --- détermination du jour de la semaine pour le premier du mois --- '
      pos_premier = Weekday(D1,2)
      pos_premier = pos_premier - 1
 
' --- détermination des variables de calcul du tableau --- '
      j=1         ' compteur de jours du mois
      l=0         ' compteur de ligne... permet de déterminer le positionnement du 1 dans la première ligne
      c=0         ' compteur de cellule... permet de déterminer le saut de ligne du tableau
      p=0         ' positionnement du premier jours du mois dans une semaine de 7 jours
%>
 
<table >
  <tr> 
    <td colspan="7"> 
      <p align="center">
      <select onchange="window.location='?an=<%= an %>&mois='+this.value">
               <option value="1" <% if mois=1 then response.write "selected" end if%> >Janvier</option>
               <option value="2" <% if mois=2 then response.write "selected" end if%> >Février</option>
               <option value="3" <% if mois=3 then response.write "selected" end if%> >Mars</option>
               <option value="4" <% if mois=4 then response.write "selected" end if%> >Avril</option>
               <option value="5" <% if mois=5 then response.write "selected" end if%> >Mai</option>
               <option value="6" <% if mois=6 then response.write "selected" end if%> >Juin</option>
               <option value="7" <% if mois=7 then response.write "selected" end if%> >Juillet</option>
               <option value="8" <% if mois=8 then response.write "selected" end if%> >Août</option>
               <option value="9" <% if mois=9 then response.write "selected" end if%> >Septembre</option>
               <option value="10" <% if mois=10 then response.write "selected" end if%> >Octobre</option>
               <option value="11" <% if mois=11 then response.write "selected" end if%> >Novembre</option>
               <option value="12" <% if mois=12 then response.write "selected" end if%> >Décembre</option>
      </select>
       - 
      <select onchange="window.location='?mois=<%=mois%>&an='+this.value">
         <% 
         for i = an_deb to an_fin 
         %>
            <option value="<%= an_deb %>"
					<% if an=an_deb then response.write "selected" end if%> ><%= an_deb %></option>
         <%
         an_deb = an_deb + 1
         next
         %>
      </select>
    </td>
  </tr>
  <tr>
  <BR>
  </tr>
  <tr bgcolor="#F4F28C" bordercolor="#F4F28C"> 
    <td align="center"><font color="#000000" size="2" face="Arial">L</font></td>
    <td align="center"><font color="#000000" size="2" face="Arial">M</font></td>
    <td align="center"><font color="#000000" size="2" face="Arial">M</font></td>
    <td align="center"><font color="#000000" size="2" face="Arial">J</font></td>
    <td align="center"><font color="#000000" size="2" face="Arial">V</font></td>
    <td align="center"><font color="#000000" size="2" face="Arial">S</font></td>
    <td align="center"><font color="#000000" size="2" face="Arial">D</font></td>
  </tr>
  <tr> 
    <% 
for i = 1 to jours_mois
      ' --- incrémentation de ma variable cellule jusqu'à la valeur 7 ---
      c=c+1
 
      if l=0 then
         for p = 1 to pos_premier
         c=c+1
         %>
             <td align="center"><font size="2" face="Arial"></font></td>
          <%
         next
      end if
      date_agenda = dateserial(an,mois,i)
      %>
       <td align="center" <% if date_agenda = date() then %> style="border:1 solid #FF0000" <% end if %> >
         <font size="2" face="Arial">
         <a href="/site/pagesnews/Copie%20de%20CDL.asp?dateserial=<%=Request.Querystring("date_agenda")%><%= date_agenda %>" ><%= i %></a>
         </font>
    </td>
    <%
      ' --- gestion du retour à la ligne après 7 jours affichés ---
            if c=7 then 
               response.write "</tr>"
               c=0 
            end if 
      ' --- incrémente la variable l précisant le passage à la deuxième ligne ---
            l=1
      ' --- boucle de mon for to next ---
next
 
%>
  </tr>
</table>
et mon code pour afficher la liste des congrès

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
 
<br>
<fieldset style="background-color:#FFFFFF"><legend><H2>Congrès du <%=UCASE(Request.Querystring("dateserial"))%></H2></legend>
<%
	Str_dateserial = Request.QueryString("dateserial")
	strRequete="SELECT * FROM Tbl_Congres WHERE Valid=1 AND debut_congres='" & Str_dateserial & "'"
	Set RsCongres=Server.CreateObject("ADODB.Recordset")
	RsCongres.Open strRequete,Connexion
	If Not RsCongres.Eof Then
%>
 
<%
	i=1
	While Not RsCongres.Eof
%>
 
<%
	If (i mod 2) then
%>
 
<fieldset style="background-color:#FFF8B0">
<legend><span class="Style3">Congres <%=RsCongres("pays")%></span></legend>
	<table bgcolor="#F9D577" width="100%">
		<tr>
			<td width="5%" align="left" valign="top"><%=i%></td>
			<td width="90%"><p>
			<img src="" alt="" width="60" height="60" />	<%=RsCongres("intitule")%> <%=RsCongres("programme")%>
			<p> du <%=RsCongres("debut_congres")%> au <%=RsCongres("fin_congres")%>
			</td>
			<td width="5%"></td>
		</tr>
	</table>
	<table bgcolor="#F9D577" width="100%">
		<tr>
			<td width="25%"></td>
			<td width="60%" align="left">
			<p> <img src="" alt="" width="40" height="40" />	<%=RsCongres("ville")%>
			<br> <%= RsCongres("lieu_congres")%>
			</td>
			<td width="15%">
			<a style="text-decoration : none" href="/site/pagesnews/CPF.asp?numero=<%=RsCongres("Id_num")%>">
			Détail...</a>
			</td>
		</tr>
	</table>
</fieldset>
 
<%
	Else
%>
 
<fieldset style="background-color:#FFF8B0">
<legend><span class="Style3">Congres <%=RsCongres("Pays")%></span></legend>
	<table bgcolor="#F9D577" width="100%">
		<tr>
			<td width="5%" align="left" valign="top"><%=i%></td>
			<td width="90%"><p>
			<img src="" alt="" width="60" height="60" />	<%=RsCongres("intitule")%> <%=RsCongres("programme")%>
			<p> du <%=RsCongres("debut_congres")%> au <%=RsCongres("fin_congres")%>
			</td>
			<td width="5%"></td>
		</tr>
	</table>
	<table bgcolor="#F9D577" width="100%">
		<tr>
			<td width="25%"></td>
			<td width="60%" align="left">
			<p> <img src="" alt="" width="40" height="40" />	<%=RsCongres("ville")%>
			<br> <%= RsCongres("lieu_congres")%>
			</td>
			<td width="15%">
			<a style="text-decoration : none" href="/site/pagesnews/CPF.asp?numero=<%=RsCongres("Id_num")%>">
			Détail...</a>
			</td>
		</tr>
	</table>
</fieldset>
 
<%
	End If
%>
 
<%
 
	RsCongres.Movenext	
	i=i+1
	Wend	
%>
 
<%
	Else
		Response.write("Aucun congrès à cette date")	
 
%>
 
 
<%
	End If		
	Set Connexion=Nothing
%>
 
</fieldset>
Merci