MVC @Html.Display()

The Display method is not for creating input boxes. You'd want to use:

@Html.TextBoxFor(m => m.TerrMng);

or the templated helper method:

@Html.EditorFor(m => m.TerrMng);

I'm assuming that you want to use modelbinding. If not, if you really just want to use a helper to simply make an input tag, use:

@Html.TextBox("TerrMng");

This would be sent to the client:

<input id="TerrMng" type="text" value="" name="TerrMng">

The first 2 methods above would result in the exact same html, if model.TerrMng was "" or String.Empty. If for some reason you don't want the value attribute, you'll need to type it out yourself.


This should do the trick if you are just wanting to display the data and not allow the user to edit the information.

@Html.DisplayFor(m => m.TerrMng);

Edit:

what-is-the-html-displayfor-syntax-for is another question on stackoverflow that may give you some more guidance.

Edit:

TerrMng does not exist on PageLoad so you cannot use the Html.Display in that way. You need to create it and fill its value with the value received from the jQuery. In this case where you would have to do the following:

HTML

 @Html.Display("TerrMng"); // This creates the label with an id of TerrMng

jQuery

 $("#TerrMng").val(TerrMng); // This puts the value of the javascript variable into the label

You could try something based on this. This is not exact but you could get some idea.

@Html.TextBoxFor(yourmodel => model.yourModelFieldname, null)