Possible duplicate:How to use the ternary operator in a razor (in particular, for HTML attributes)?
I am trying to do the following, but its an error, so I am obviously doing something wrong with Razor syntax:
<td>@{item.Licence.MachineId != null ? @:"TB Master" : @:"HandHeld"} </td>
The following should work:
<td>@(item.Licence.MachineId != null ? "TB Master" : "HandHeld")</td>
try it
Source: https://habr.com/ru/post/890073/More articles:Remote form in rails 3 app submit as html - jqueryCount the number of results for a specific word on Twitter - apiValidation with backbone.js and Ruby on Rails - validationDoes SharePoint support VBA? - vbaXcode 4: close all documents? - xcode4git conflict with submodule union: how to visualize? - gitRetrieving data from an RSA public key - javaOpening an Excel application from Python - pythonRelative Marking in Matlab Charts - matlabHow can I get the devenv.exe path to install vspackage? - visual-studio-2008All Articles