Solved

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

Posted on 2014-11-06
1
140 Views
Last Modified: 2014-11-10
Using MVC on a DropDown, How Do You Call a Partial View?  

Thanks,

Dan
0
Comment
Question by:danielolorenz
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 40428641
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now