Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

On MVC How Do You Call a Partial View From a DropDown Change Event?

Using MVC on a DropDown, How Do You Call a Partial View?  

Thanks,

Dan
0
danielolorenz
Asked:
danielolorenz
1 Solution
 
Bob LearnedCommented:
That sounds like you need for the drop-down to post back, so that you can assign an action to the post-back.  That would require something like a JQuery request.  You can use the Html.BeginForm to create a <form> element, with an action that is associated with a controller method.  In the controller method, you can return a PartialViewResult.

$(document).ready(function () {
    $('form').find('select.auto-post').change(function () {
        $(this).parents('form').submit();
    });
});

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now