asp.net - Shorter way of writing data to a view -


I am trying to figure out what a small way to write data compared to what I am currently doing It's currently in my opinion:

  & lt; Td> & Lt;% If (Model.AnnualIncome! = Null) {%> & Lt;%: "R" + Model Exclusive inc. Toasting ()%> & Lt;%}% & gt; & Lt; / TD & gt; Is  

Having all the & lt; %%> a small way to display annual revenue in the screen?

Thanks

some should be more concise.

Edit : Oh, just realized that you do not want to print "R" if it is zero. In that case, something like this:

  & lt;% = (Model.AnnualIncome == zero? "": String.Format ("R {0}", Model.AnnualIncome))% & Gt;  

Comments