How to undo JQuery selector html() redirect?
P粉864594965
2023-08-01 10:40:40
<p>How do I unit redirect the HTML settings to my section after I'm done with it?<br /><br />I use an ajax call to retrieve the data for the section view. JQuery html() helps redirect the response locally. However, in this solution, there is a refresh happening, which triggers OnGet and refreshes the entire page. In this case, full page refreshes are now directed to the partial view index of the index. cshtml page. </p><p><br /></p>
<pre class="brush:php;toolbar:false;">$.post('/reports/AddReportData',
formData
)
.done(function (response) {
$("#myPartialView").html(response);
});</pre>
<p><br /></p>
In my case there was a routing issue causing the second post to OnPost(). Solving the routing problem is the solution.