Click here to Skip to main content
12,242,431 members (46,412 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

<h2>CreateSettings</h2>

but I get no results

[HttpPost]
   public ActionResult Edit(DevicesViewModel collection)
   {
 
       try
       {
           // TODO: Add update logic here
collection -> DevicesForCurrentUser = null
Posted 21-Nov-12 13:44pm

1 solution

Rate this: bad
 
good
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

http://stackoverflow.com/questions/5247485/httppost-does-not-work-asp-mvc-3[^]

Please check.
  Permalink  

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.160426.1 | Last Updated 8 Apr 2014
Copyright © CodeProject, 1999-2016
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