locked
Refresh Partial View RRS feed

  • Question

  • Hi,

    I am developing a Web Application with Asp.NET MVC5. As I dont have much experience, I am stuck with a functionality using JQuery and Partial View.

    I have a Side Menu as a partial view in a page. This partial view contains a DropdownList which is populated from model, and it works fine. However, I want to display a list of items from the db when the dropdown is selected, based on the selection, which is not working. 

    Partial View (_UserPartialView)

    $('#dropdown').change(function(){
    var item = $(this).val(); 
    $.get("/Controller/GetItems/" +  item, function(data)
    {
       ('#target').html(data); 
    });

    Controller

     

    public ActionResult (int id)
    {
       var test = db.Users.Where(e => e.cId = id);

       return PartialView(" _UserPartialView", test);
    }

    Please help.

    Thanks

    Mrutyunjaya

    Friday, August 3, 2018 11:22 AM

Answers

  • Hi Mrutyunjaya,

    Welcome to the MSDN forum.

    It seems your issue is about the ASP.NET MVC development and since our forum is to discuss the .NET Framework installation issues, please redirect to this appropriate forum: https://forums.asp.net/1146.aspx/ and start a new thread for a better support, thank you for your understanding.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by MRUTYUNJAYA.M Friday, August 10, 2018 6:14 AM
    Monday, August 6, 2018 8:42 AM