Mian Almas Mian Almas - 4 months ago 17
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