In ASP.Net MVC 3 I have a Controller and View with a portion of the view’s html in a <div> whose text I would like to swap out, depending on some action– a button press, for instance.
Assuming my view has two <div>s, the top being the part I’d like to swap out based on an input element in the lower <div> being selected, what is a good way to asynchronously do this? jQuery and ajax are welcome for the task though not required.
[edit] I should have mentioned originally, I’d like to render the content of the asynchronous by calling a partial view or something similar. Unfortunately I’m a little new to that and was hoping for quick guidance on how (if?) to call a partial view using ajax or other such techniques.
This is relatively simple.
where id is the id you have assigned to your div. Or you can use any other selector to chose the correct div.
Examples here: http://api.jquery.com/html/