Solved

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

Posted on 2014-11-06
1
143 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
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.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

24 Experts available now in Live!

Get 1:1 Help Now