Click here to Skip to main content
12,756,447 members (31,997 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET
Hello to all.This is my first project with MVC.I have a question relating to MVC and will hopefully help me. My English is very bad for that I apologize.I want to update an object but not getting the desired result.

This is my current viewModel
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SmartHomeMVC.ViewModel
    public class DevicesViewModel
        public List<Device> DevicesForCurrentUser { get; set; }
        public Room CurrentRoom { get; set; }

This is my view


but I get no results

        public ActionResult Edit(DevicesViewModel collection)
                // TODO: Add update logic here

collection -> DevicesForCurrentUser = null
Posted 21-Nov-12 13:44pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I think you need to specify your post method name to pass your data to server while using MVC.

I think same problem is also posted at below link[^]

Please check.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 8 Apr 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100