Wednesday, 27 January 2021

MVC - jQuery - Modify @Html.DisplayFor

 

 

 

Watch this example on YouTube

 

 

@model WebApplication1.Models.OrderCustomClass

@using (Ajax.BeginForm("", "",null, new { @id = "frm" }))
{
    <div class="ModifyClass">
        @Html.DisplayFor(x => x.or.Column3)
        <br />

        
    </div>  
}
<input type="button" id="btnSubmit1" onclick="ModifyDisplay()" value="Modify Display For" />

    @section Scripts{
    <script type="text/javascript">
        function ModifyDisplay() {
           $('.ModifyClass').html('some new value')
        }
    </script>
    }

No comments:

Post a Comment