boolean - Help with c# and bool on asp.net mvc -


The best way to touch "yes" or "no" by value

Idea I want to print

Model.isStudent

And I do not want to be right or wrong, I do not want to or yes ... would I have to tell if any statement?

Write a helpful method:

  public stable class MyExtensions {public Fixed String FormatBool (this HtmlHelper html, Boole Value) {return html.Encode (value? "Yes": "no"); }}  

and use it like this:

  <% = html.formatBool (Model.IsStudent)% & gt;  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -