Reputation: 46
<%
i=1
j=1
if ((i=1) && (j=1)) then
response.write("i = 1 and j =1")
else
response.write("i <> 0")
end if
%>
I'm saving this with a .asp
extension. Here the if
condition is not working. How can I check 2 conditions in if
condition of classic ASP code?
Upvotes: 1
Views: 13115
Reputation: 218828
I think the logical operator you're looking for is And
in this case:
if ((i = 1) And (j = 1)) then
Upvotes: 3
Reputation: 45490
The operator is and
not &&
so change your code to:
<%
i=1
j=1
if ((i=1) and (j=1)) then
Response.Write("i = 1 and j =1")
else
Response.Write("i <> 0")
end if
%>
i = 1 and j =1
Upvotes: 1