Link to home
Avatar of Tony Pearce
Tony PearceFlag for United Kingdom of Great Britain and Northern Ireland

asked on

If Else statement in C++ asp.net

Hi,
I have a IF ELSE on an aASP.NET page as below, that should check if the value of 'custom4' equals 2007 or 2008 (stored as NVARCHAR255, stuck at this!) why does it not work, reaaly fustrating as should be so simple!!
any help very welcome

Tony

<%
if (Session["Custom4"]  != null && Session["Custom4"].ToString() == "2008")
{
}
if (Session["Custom4"]  != null && Session["Custom4"].ToString() == "2007")
{
}
else
{
Response.Redirect("expireyear.aspx");
}
%>
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Tony Pearce

ASKER

How did you do that so quickly? thanks so much for your help.
Tony
>> How did you do that so quickly?
Honestly, I guessed -- but since your logic looked, ostensibly, right the only thing I could see was it might be an order of evaluation issue. :)