search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Using if/else statement in C# Razor
Posted in Windows Server | No Comment | 1,223 views | 02/08/2015 18:51

Just a reminder for myself :)

@(userRole == 0 ? "Yes" : "No")

Also you can use this like “else if”:

@(userRole == 0 ? "Yes" : userRole == 1 ? "Yes" : "No")

You can use this statement in div tags without problem.



Leave a Reply