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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -