Mian Almas Mian Almas - 1 year ago 91
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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download