Link to home
Start Free TrialLog in
Avatar of PSCTECH
PSCTECH

asked on

C# syntax error

I am trying to see if one of three conditions is true.  I keep getting "Operator '||' cannot be applied to operands of type 'string' and 'string'
Any help would be appreciated.

if (Model.StatusType.ShortDescription() = "S" ||  
    Model.StatusType.ShortDescription() = "HOH" || 
    Model.StatusType.ShortDescription = "QW")
               return GoTo(typeof(Page2));

Open in new window

Avatar of p_davis
p_davis

you need == for comparison checks = assigns a value
Model.StatusType.ShortDescription() == "S"
ASKER CERTIFIED SOLUTION
Avatar of p_davis
p_davis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PSCTECH

ASKER

Thanks for the rapid accurate response