Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Langages serveur > ASP
ASP Forum sur la programmation ASP. Avant de poster : Cours ASP, FAQ ASP
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 01/08/2007, 10h34   #1
Invité de passage
 
Inscription : juillet 2007
Messages : 3
Détails du profil
Informations forums :
Inscription : juillet 2007
Messages : 3
Points : 1
Points : 1
Par défaut ASP petit problème à propos sur une boucle if

Bonjour à tous,

Je suis novice en ASP, je viens seulement de débuter, lors de mon stage il m'est demandé de reprendre des programmes en asp et j'ai un petit problème.
voici mon problème:

voilà le code:

Code asp :
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
<table border="0" cellpadding="2" cellspacing="2" align="center" width="100%" borderColor="#adc3de">
		<tr>
			<td colspan="2" align="center" bgColor="#adc3de">
				<b>
				<%
				If pt.item(1).PointAttributes("pointSource").Value = "Z" Then
					'microZ
					Response.Write("INFOS µZ sur " & pt.item(1).name)
				Else
					Response.Write("INFOS Foxboro sur " & pt.item(1).name)
					'If pt.item(1).PointAttributes("pointSource").Value = "C" Or pt.item(1).PointAttributes("pointSource").Value = "K" Or pt.item(1).PointAttributes("pointSource").Value = "Lab" Then
					'	Response.Write("INFOS sur " & pt.item(1).name)
					'Else
					'	
					'	If pt.item(1).PointAttributes("pointSource").Value = "F" Then
					'		Response.Write("INFOS Foxboro sur " & pt.item(1).name)
					'	Else
					'		
					'		If pt.item(1).PointAttributes("pointSource").Value = "O" Then
					'			Response.Write("INFOS OPC sur " & pt.item(1).name)
					'		Else
					'			
					'			If pt.item(1).PointAttributes("pointSource").Value = "P" Then
					'				Response.Write("INFOS PI To PI sur " & pt.item(1).name)
					'			Else
					'				
					'				If pt.item(1).PointAttributes("pointSource").Value="M" Then
					'					Response.Write("INFOS Modbus sur " & pt.item(1).name)
					'				End if
					'				
					'			End if
					'			
					'		End if
					'		
					'	End if
					'	
					'End if
 
				End if
				%></b>
			</td>
		</tr>

le problème est que je veux afficher i"nfos microZ" si le pointSource est Z sinon je veux "infos foxboro" mais le souci est que le programme ne prend pas en compte le else donc il écrit "infos microZ qd c'est le cas sinon il m'est rien autrement.




est ce que quelqu'un peut m'aider SVP???
Merci d'avance à ceux qui veulent bien m'aider...
nicodu59.

---------
Utilise la balise code (#) la prochaine fois quand tu mets du code dans la page c'est fait pour ça la balise
nicodu59 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/08/2007, 12h27   #2
Modérateur
 
Avatar de kaiser59
 
Inscription : novembre 2005
Messages : 1 246
Détails du profil
Informations personnelles :
Âge : 32

Informations forums :
Inscription : novembre 2005
Messages : 1 246
Points : 1 203
Points : 1 203
Envoyer un message via MSN à kaiser59
Salut,

Essaye ceci :
Code asp :
1
2
3
4
5
6
7
8
<%
if pt.item(1).PointAttributes("pointSource").Value = "Z" Then
	'microZ
	Response.Write "INFOS µZ sur " & pt.item(1).PointAttributes("pointSource").name
else
	Response.Write "INFOS Foxboro sur " & pt.item(1).PointAttributes("pointSource").name
end if
%>

++
__________________
Ne dites pas Java pour dire Javascript ! Ces deux codes n'ont rien à voir ! // Essayez d'expliquer, de la façon la plus claire possible votre problème. // Parfois une image vaut mieux qu'un long discours

FAQ ASP
kaiser59 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/08/2007, 10h21   #3
Invité de passage
 
Inscription : juillet 2007
Messages : 3
Détails du profil
Informations forums :
Inscription : juillet 2007
Messages : 3
Points : 1
Points : 1
merci beaucoup de m'voir répondu,ça marche
nicodu59 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 08h30.


 
 
 
 
Partenaires

Hébergement Web