DisplayFor generates an HTML tag <label id="myId" class="myClass">Some Text</label> . (erroneous)
EDIT
I was wrong and thought you were using the LabelFor . The DisplayFor helper does not display HTML markup (such as a label or span tag). If you want this to work with the DisplayFor helper, you need to wrap the DisplayFor tag with <span> or something similar, as shown below:
<span class="TitleEstTimeClass" style="color: green"> @Html.DisplayFor(model => model.EstimatedTime) </span>
Given this, try using the .html() JQuery property, as shown below: this is really no different from updating text in a div or span:
$(".TitleEstTimeClass").html(result[1]);
Also, make sure that your jQuery call is in the appropriate <script></script> and that the function you are calling is actually running. I'm not sure if the above code is straight from your project or just fragments, but as written above, nothing will happen.
Tommy
source share