jquery - How to change contents of div in .cshtml without reloading whole page in ASP.NET MVC 5 -
how change contents of div in .cshtml without reloading whole page in asp.net mvc 5
<div class="status-container" style="display:none"> <div class="status-block"> @if (model.dropdownlist.selectedvalue = 1) { <span class="status-title"> consultations : </span> } else { <span class="status-title"> sheduled : </span> } </div> </div>
first time debug comes. not debug page further.. not reload again.
you can use ajax , make call controller , data wanted change. sample code below.
<script> $.ajax({ url: '/controllername/funname', //@url.action("funname","controllername") type: 'get', datatype: 'html', data: { selectedvalue: selectedvalue }, success: function (data) { //make function return partial view want fetched in data $('#dynamiccontent').html(data); } }); </script>
Comments
Post a Comment