Questions tagged [editmodel]

8 questions
9
votes
4 answers

How to mutate editmodel/postmodel to domain model

In an ASP.NET MVC project we are using AutoMapper to map from domain model to viewmodel - and sometimes also flattening a hierarchy while doing so. This works like a charm and makes the rendering logic of our views very lean and simple. The…
8
votes
2 answers

Reference implementation of ASP.NET MVC using ViewModels, EditModels, and AutoMapper

A simple question: is there a good reference implementation of using ASP.NET MVC with an ORM, ViewModels, and EditModels (ideally using Automapper)? I understand the benefits of using these purpose-specific models, but haven't been too happy with…
STW
  • 44,917
  • 17
  • 105
  • 161
1
vote
2 answers

Popup Calendar in edit mode of asp.net gridview

All respected, I have a Master detail project asp.net (sql data) project in which Master.aspx along with code behind page Master.aspx.cs. Following is the code:
user1235981
  • 21
  • 2
  • 7
1
vote
1 answer

How should I map Edit Models to Domain Models

I'm trying to understand the best way to map the fields in an Edit Model (posted back from a view form) to a Domain Model so that I can SubmitChanges() and update the database record (via Linq to SQL). My example will be simple and the answer to it…
BKahuna
  • 601
  • 2
  • 11
  • 23
1
vote
2 answers

Map EditModel using Automapper

I'm stuck trying to map ViewModel class using Automapper with classes listed below: public class Product { [Key] public int ProductId { get; set; } public string Name { get; set; } public ICollection Color { get; set;…
0
votes
1 answer

How to handle model validation when the bound edit model != view model

I have a situation in ASP.NET MVC 2 where I have a form whose fields are based on info supplied by a view model, but whose posted data is a subset of that data represented by a slimmer edit model. I'd like to add simple data annotation validation…
Major Productions
  • 5,914
  • 13
  • 70
  • 149
0
votes
1 answer

Jqgrid custom formatter and edit mode

It appears that using a custom formatter makes the cell stuck in the edit mode and previously edited row never gets restored. JS, grid defined here $(priceListGrid).jqGrid({ datatype: 'local', url:…
sarsnake
  • 26,667
  • 58
  • 180
  • 286
0
votes
3 answers

can't update an existing record in CakePHP

i write a edit function to update user's info, my code: if($this->request->is('post')){ $this->request->data['User']['password']=Security::hash($this->request->data['User']['password'],'sha1', Configure::read('Security.salt')); …
Makio
  • 465
  • 6
  • 15