I am trying to display different messages based on data from statusid table. Let say for example if my statusid is 1120 then i would like to display "PASS" but i am struggling with the correct syntax.
If statusid=1120 then "PASS".
Here is my code for displaying statusid:
@Html.DisplayFor(modelItem => item.statusid)
Any idea?
Make an object with all the properties you need
SomeObject.statusId
SomeObject.message
@Html.DisplayFor(modelItem => item.SomeObjectInstance)
Doing it this way let's you add the code and logic outside the view, which is generally recommended.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With