Laura
Laura

Reputation: 71

Debugger executes IF when the consition is FALSE

I have run out of all the posibilities with the next piece of code. The condition in if is false therefore the if should not be executed. But, using the debugger, the execution goes to the second line, which is Response.Redirect.

If False Then
            SaveData()
            Response.Redirect("Lop_Approved_Results.aspx?lopId=" & lopId, True)
End If

Why this is happen?

Upvotes: 0

Views: 56

Answers (2)

Frodo Baggins
Frodo Baggins

Reputation: 8543

If that is really the logic then what your debugger is showing simply isn't what your computer is executing (debuggers aren't perfect). Have you tried closing down, restarting your IDE and cleaning out the project? Do you actually see the redirect occur, as opposed to only seeing the debugger claim to enter this branch?

Upvotes: 0

Hans Olsson
Hans Olsson

Reputation: 55039

Sounds like your source code might be out of date with your binaries. Try doing a Clean Solution and maybe closing down Visual Studio and then re-build all and see if that helps.

Upvotes: 1

Related Questions