views:

33

answers:

1

hello all,

I have an mvc application in which I want to make the texbox readable,i have used the following syntax it is not working.please tell me where am I going wrong

<%= Html.TextBox("upperlimit", String.Format("{0:F}", Model.upperlimit, new { @readonly = (Model.upperlimit != null ? "readonly" : "false") }))%>
<%= Html.ValidationMessage("upperlimit", "*") %>

Thanks in advance Ritz

+1  A: 

Try this:

<%= Html.TextBox(
    "upperlimit", 
    String.Format("{0:F}", Model.upperlimit), 
    new { 
        @readonly = Model.upperlimit != null ? "readonly" : "false" 
    })
%>
Darin Dimitrov
Thank you Mr.Darin Dimitrov.Thanks very much
Ritz