When I am just deleting the editor fields that I dont' want the user to see in the View , their data becomes null, I want to keep the data, but ,I don't want the user to edit it.
<div class="editor-label">
@Html.LabelFor(model => model.Name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.parent_directory)
</div>
<div class="editor-field">
@Html.DisplayFor(model => model.parent_directory)
</div>
<p>
<input type="submit" value="Add" />
</p>
The @Html.EditorFor I am referring to is model.parent_directory. Can anyone suggest a solution that doesn't involve js ? I tried using DisplayFor instead of EditorFor and I still get a null value.