views:

464

answers:

1

I'm trying to display a disabled textbox with the value 'FL' in it. Somehow the textbox does not have any value when it is displayed, but it is disabled. How do you display a value in a disabled textbox?

<%= Html.TextBoxFor(model => model.State, new { value="FL", disabled="disabled" }) %>
+1  A: 

I think the code:

Html.TextBoxFor(model => model.State, new { disabled="disabled" });

is the code you need.

In the model, set the State = 'FL' & it should work correctly...

HTH.

Sunny
How do you set "state" in the model? Is it an attribute?
Jack Marchetti
Sunny