I'm using Ajax.ActionLink
in a view that I have on an ASP.NET-MVC application and I'm using InsertionMode.Replace
, but I see there's also a ReplaceWith
option. What's the difference between the two? Does one replace something more/less than the other one. I need the div I'm replacing to be completely replaced with the partial view.
I can't find a comparison anywhere on google
Replace
will replace the content with the new content. ReplaceWith
will replace the entire element.
<body>
<div id="myResults">
<p> Results will be displayed here </p>
</div>
</body>
Response from ajax
<span>This is the result</span>
with Replace
option targeting myResults
<body>
<div id="myResults">
<span>This is the result</span>
</div>
</body>
using ReplaceWith
option targeting myResults
<body>
<span>This is the result</span>
</body>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With