Click here to Skip to main content
15,919,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
@if (Model.Amount!=null)
       {
           <tr>
               <td>Amount</td>
               <td>:</td>
               <td>

                   @Html.EditorFor(model => model.Amount, new { @readonly = "true"})
                   @Html.ValidationMessageFor(model => model.Amount)
               </td>
           </tr>
       }
Posted

1 solution

 
Share this answer
 
Comments
Member 11621271 20-Apr-15 3:43am    
Actually i need to make editor to readonly = true when amount is not null and readonly = false when amount = null.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900