In my HTML file, I have a textbox which must be disabled or enable, depending on my controller value. No problem to set it in disabled mode, but to set it enable...
this is my code :
<%= Html.TextBoxFor(model => model.test, new Dictionary<string, object> { { "disabled", ViewContext.RouteData.Values["controller"].ToString() == "MyTest" ? "" : "disabled"}}
I have seen some ideas on this question : here
mvccontrib.FluentHtml or InputExtensions are the single solutions, to answer to my question ???
Im using "disabled" but I can use "read-only" attribute... the goal of this code is not to allow the user to fill the text box...
Thanks for your advices on the subject.