Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Refresh Partial View

Refresh Partial View

Scheduled Pinned Locked Moved C#
helpcsharpjavascripthtmlasp-net
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sunsher
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • S sunsher

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      sunsher wrote:

      I am developing a Web Application with Asp.NET MVC5

      Then please post your question in the ASP.NET forum.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups