I have a view component inside my view
@await Component.InvokeAsync("UserProfileCard")
and I want when I click on a button only this component will be refresh without refreshing the page with using jquery ajax or jquery Unobtrusive
I have a view component inside my view
@await Component.InvokeAsync("UserProfileCard")
and I want when I click on a button only this component will be refresh without refreshing the page with using jquery ajax or jquery Unobtrusive
2
Answers
create div around component
create action
ajax
Using jQuery the way i know is by repainting the .html() of the div/span the page is rendered in and refreshing it with new content of the component
eq: let us assume userProfileCard is a div then code would be like-:
$("#userProfileCard").html(newData)