Cecil
Cecil

Reputation: 1619

ASP - OR statement not working

I have the following statement which is not working, im wondering if someone could help me out and tell me where im going wrong

<% If ((urlFilename <> "calculators.aspx") Or (urlFilename <> "case-studies.aspx")) Then %>
    <div class="block-quote">
    </div>
<% End If %>

Upvotes: 0

Views: 9036

Answers (1)

Louis Waweru
Louis Waweru

Reputation: 3672

The code between If and End If will always fire because one of those tests will always be true.

If urlFilename = "home.aspx" both conditions are satisfied, and the code will fire.

If urlFilename = "calculators.aspx" the first condition fails, but the second is met, and the code will fire.

If urlFilename = "case-studies.aspx" the first condition is met...

Upvotes: 2

Related Questions