these days i'm working on a project, based on MVC 4. i have to requirement to refresh partial view which use to display data from database on a view. this partial view refresh only not whole view page? thanks
Hi Tanuj For refreshing Partial View use given line of code Step 1. Use script for calling Action for calling partial view
<script type="text/javascript"> function OpenPoupWindow{ $.post('@Url.Action("RefreshPartialView", "AdminPanel")', { 'parentid': "PassParameterValue"}, function (data) { $("#PartialViewContainer").html(data); }); } </script>
Note: "OpenPoupWindow" funcation "RefreshPartialView" Action name "AdminPanel" controller name "PartialViewContainer" id of table or div etc, witch contain partial view for display data, like this
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
For refreshing Partial View use given line of code
Step 1. Use script for calling Action for calling partial view
Note: "OpenPoupWindow" funcation
"RefreshPartialView" Action name
"AdminPanel" controller name
"PartialViewContainer" id of table or div etc, witch contain partial view for display data, like this
Step 2. Action for calling partial view
Note: "ProductsManagerPartialView" partial view name
"ProductsListItem" Properties name
i hope this will be help full for you