learning
learning

Reputation: 11745

readonly in asp.net mvc

How do I make a textbox read only in mvc? I have included the following snippet, but it`s not working.

 <%=Html.Textbox("test", "test", new { style="border: 0px; width:280px" ;readonly=true}%>

Upvotes: 1

Views: 2741

Answers (1)

George Stocker
George Stocker

Reputation: 57907

<%=Html.Textbox("test", "test", new { style="border: 0px; width:280px", @readonly =  "readonly"}%>

Upvotes: 3

Related Questions