Bonjour,
je viens de faire une liste déroulante dynamqiue...mais lors d'une selection d'un élément de la liste, je suis sencé avoir des données appartenant à l'élément choisis;
il ne rentre pas dans le else de cette condition ::
donc à chaque changement de liste j'ai nbEnr = 0,

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
 
 
<% if nbEnr= 0 then%>
 
<table id="Table1" cellSpacing="0" cellPadding="2" width="80%" align="center" bgColor="#6699cc" border="0">
	<tr>
	<td width="100%" bgColor="#0871a4">
	<p class="txtblanc">Resultado de su búsqueda</p>
 
<% else %>


je débute en asp alors passer du php au asp
en fait j'ai repris un projet, il y avait une liste déroulante en "dur", et j'ai réussi à la faire dynamique.. mais les éléments ne s'affichent plus quand je selectionne un élément

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
 
 
 
	<form id="Form1" style="LEFT: 0px; WIDTH: 525px; POSITION: absolute; TOP: 0px; HEIGHT: 264px"
			method="get" runat="server">
			<div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: #0871a4; PADDING-BOTTOM: 0px; MARGIN: 0px; WIDTH: 525px; PADDING-TOP: 0px; HEIGHT: 20px"></div>
			<div style="BACKGROUND: url(img/banner_bottom_recherche.jpg); WIDTH: 525px; HEIGHT: 65px">
					<div style="FLOAT: right; WIDTH: 300px; PADDING-TOP: 39px; HEIGHT: 61px">
					<div class="dep-template">Provincia:</div>
					<select name="ListProvEs" onchange="javascript:document.all.Form1.submit()">
						<% Dim i as int16%>				
						<option value="-1" selected>- Provincia -</option>
						<%Dim province(50) 
						for i=1 to jeuPage.count %>
						<option value="<%=jeuPage.lecture(i,"Region")%>" 
							<% if request.form("ListProvEs")(i)=jeuPage.lecture(i,"Region")
								then response.write "selected" 
								End If
							%>	
						>
							<%=jeuPage.lecture(i,"Region")%>
						</option>
						<% next %>
 
					</select>
					</div>
			</div>
 
			<% if nbEnr= 0 then	 %>
			<br>
			<table id="Table1" cellSpacing="0" cellPadding="2" width="80%" align="center" bgColor="#6699cc"
				border="0">
				<tr>
					<td width="100%" bgColor="#0871a4">
						<p class="txtblanc"><b style="FONT-WEIGHT: bold; FONT-SIZE: 11pt; COLOR: white; FONT-FAMILY: Arial">
						Resultado de su búsqueda</b></p>
					</td>
				</tr>
				<tr bgColor="#ebf4fd">
					<td vAlign="top" colSpan="2">
						<P><span class="txt11" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial">Ningún resultado corresponde a su petición.</span>
						</P>
					</td>
				</tr>
			</table>
			<% else %>
			<table cellSpacing="0" cellPadding="0" width="525">
				<tr height="20">
					<td class="corps-template" width="10"></TD>
					<td class="corps-template" width="84" style="WIDTH: 84px">Razón social</td>
					<td width="1"></td>
					<td class="corps-template" width="153">Dirección</td>
					<td width="1"></td>
					<td class="corps-template" width="95">Teléfono/Fax</td>
					<td width="1"></td>
					<td class="corps-template" width="50">Web</td>
					<td width="1"></td>
					<td class="corps-template" width="25">E-mail</td>
				</tr>
				<%
				for i=0 to 50 %>
				<tr style="BACKGROUND: url(img/bg_sub_menu_prod.gif)" height="30">
					<TD class="contenu" width="10">&nbsp;</TD>
					<td class="contenu" style="WIDTH: 84px"><%=jeuPage.lecture(i,"Raison_sociale")%></td>
					<td><IMG style="FLOAT: right" height="26" src="img/DOT_SEP_REV1.gif" width="1"></td>
					<td class="contenu"><%=jeuPage.lecture(i,"Adresse")%><br>
						<%=jeuPage.lecture(i,"cdp")%>
						&nbsp;
						<%=jeuPage.lecture(i,"Ville")%>
					</td>
					<td><IMG style="FLOAT: right" height="26" src="img/DOT_SEP_REV1.gif" width="1"></td>
					<td class="contenu">
						<%=jeuPage.lecture(i,"tel")%>
						<br>
						<%=jeuPage.lecture(i,"fax")%>
					</td>
					<td><IMG style="FLOAT: right" height="26" src="img/DOT_SEP_REV1.gif" width="1"></td>
					<td class="contenu">
						<% if jeuPage.lecture(i,"site_internet")>"" then%>
							<p align=center><a style="color: #000000" href=http://<%=jeuPage.lecture(i,"site_internet")%> target=_blank>WWW</a></p>
						<%End if%>
					</td>
					<td><IMG style="FLOAT: right" height="26" src="img/DOT_SEP_REV1.gif" width="1"></td>
					<td class="contenu"><% if(jeuPage.lecture(i,"E_mail")<>"")then %><A href='mailto:<%=jeuPage.lecture(i,"E_mail")%>' ><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px; TEXT-DECORATION: none"
								src="img/ICON-EMAIL_REV.gif"></A><% End if %></td>
				</tr>
				<% if(jeuPage.lecture(i,"Raison_Sociale")<>"")then %>
				<tr>
					<TD width="10"></TD>
					<td colSpan="10"><IMG src="img/bar_blue_rev.gif" width="525"></td>
				</tr>
				<% end if %>
				<%next i %>
	</table>
			<% end if %>
			<DIV style="LEFT: 264px; FLOAT: right; WIDTH: 100%; TOP: 320px; HEIGHT: 24px; BACKGROUND-COLOR: #0871a4"
				align="center"><asp:linkbutton id="LinkButton1" runat="server" cssclass="link-A" Width="49px" Height="16px">< 0</asp:linkbutton><asp:linkbutton id="LinkButton2" runat="server" cssclass="link" Width="20px" Height="16px">1</asp:linkbutton><asp:linkbutton id="LinkButton3" runat="server" cssclass="link-A" Width="29px" Height="16px">2 ></asp:linkbutton></DIV>
		</form>