Difference between MVC 3 Partial Page (Razor) and MVC 3 View Page with Layout (Razor)?This is one of the basic differences not mentioned in previous comments: Readonly property will work with textbox for and it will not work with EditorFor. I have a textboxfor control in my ASP.NET MVC view as follows Html.TextBoxFor(o > o.Owner, new readonly "readonly", style "background:C0C0C0" ) if I make this textbox disabled, the font color is grayed out. Home > ASP.NET MVC > ASP.NET MVC 16 Html.TextBox and Html.TextBoxFor Helper Methods.II) We can also set the value of the textbox by sending the ViewData from controller to view as follows. Can I set the textbox to read-only when using Html.TextBoxFor?In "old" ASP.NET we used to do something like this: < Page EnableSessionState" ReadOnly" > Is there an ASP.NET MVC equival. Here, I will show you how to add conditional attribute to Razor HTML helpers in ASP.NET MVC Razor syntax? For example, if you want to add readonly readonlyIf you want to use HTML.TextBox then you need to follow below approach: Html.TextBoxFor( model > model.