Mian Almas Mian Almas - 1 month ago 6x
C# Question

Updating Partial Views From Controller in .Net MVC

I want to update the Partial Views from Controller means one Partial View is on the page but when I want show record for second it keeps the record of previous and append new Partial View to the previously added Partial View.


You can use Jquery Ajax for this Try something like this..

$('#Yourbutton').on('click', function(){
        url: '@Url.Action("YOUR Action", "YOUR Controller")',
        dataType: 'html',
        cache: false,
        async: true,
        data : {Yourparam1:value ,YourParam2:value }
        success: function(result){

Here I assume that there is a div in your page to hold partial view data