Questions tagged [updatemodel]
217 questions
3
votes
2 answers
MVC UpdateModel when the names don't match up
Let's say that you have a Model that looks kind of like this:
public class MyClass {
public string Name { get; set; }
public DateTime MyDate { get; set; }
}
The default edit template that Visual Studio gives you is a plain textbox for the…

swilliams
- 48,060
- 27
- 100
- 130
2
votes
1 answer
Model Binding - Type in External Assembly
I have a type in an assembly which isn't referenced by the core library but is referenced from the web application. e.g.
namespace MyApp.Models {
public class LatestPosts {
public int NumPosts { get; set; }
}
}
Now i have the…

nfplee
- 7,643
- 12
- 63
- 124
2
votes
2 answers
Upgrade asp.net MVC from Beta to Release 1.0
a) At the moment I have a deployed app on live on asp.mvc beta ... but few days ago it refuses to work with following error:
Method not found: 'System.String System.Web.Mvc.Html.LinkExtensions.RouteLink(System.Web.Mvc.HtmlHelper, System.String,…

ruslander
- 3,815
- 4
- 32
- 34
2
votes
1 answer
MVC3 - jQuery datepicker when multiple elements have the same ID
I have a weird situation (don't we all?) with datepickers and want to get some advice.
I have a screen with a list of Locations, and for each Location, they can click Edit and edit that location. The Edit displays below the Edit link, and they can…

James in Indy
- 2,804
- 2
- 25
- 25
2
votes
1 answer
How do I use (Try)UpdateModel?
What is the right way to use (Try)UpdateModel?
When I run this:
TryUpdateModel returns true,
ViewData has no errors,
but my Proxy is not updated.
Action Method
public void Save(string TypeName, int Id, FormCollection idontknow) {
var types =…

Benjamin
- 3,134
- 6
- 36
- 57
2
votes
2 answers
Laravel | Updating the Logged-In User - save() vs update()
I want to update a field of the logged-in user.
In my controller, this works:
Auth::user()->the_field = $theField;
Auth::user()->save();
This doesn't:
Auth::user()->update(['the_field' => $theField]);
I would expect this to work since similar code…

padawanTony
- 1,348
- 2
- 22
- 41
2
votes
2 answers
MVC Controller independent of Type of view UpdateModel
I want to use the updateModel in a controller that has no notice of the type of the view.
I have different views that have different types but all have an ExternalBase class as inherited type.
So in my controller I always have a ExternalBase but…
Bamelis Steve
2
votes
2 answers
UpdateModel won't properly convert a boolean value
I have a custom object called S2kBool that can be converted to and from a regular Boolean object. Basically, it allows my application to treat boolean values in my legacy database the same way it treats C# booleans. Then problem is, when I attempt…

David Brown
- 35,411
- 11
- 83
- 132
2
votes
4 answers
ASP.NET MVC Update Model Doesn't Work?
I'd like to update a Client type entity.
[HttpPost]
public ActionResult Manage(String id, FormCollection collection)
{
// Create service
ClientService service = new ClientService();
// Read existing client
Client c =…
user338195
2
votes
1 answer
Store update, insert, or delete statement affected an unexpected number of rows (0),
Hope you are doing well.
Kindly help me to resolve this.I am using below code in ASP.NET mvc web Application.
[HttpPost]
public ActionResult ProductAddonsAdd(int? id, tblproductattributemapper model, string AllStorechk, int? ddlProduct,…

Devendra Lodha
- 59
- 1
- 9
2
votes
1 answer
Update array in codeigniter
I have a table menu w/c contains of(recipe_id,ingredient_id,category_id).I was trying to update my ingredients yet it only update 1 ingredient_id. Like this
Here is my code :
CONTROLLER:
public function…

MSE
- 73
- 1
- 2
- 7
2
votes
1 answer
How to make CURL call from CMD line (Win 7) to MVC action with parameter?
I'm building the REST-full API with CRUD actions in Yii 2.0 and I need help for update action.
In my Yii 2.0 MVC controller I have actions create and update as follow:
public function actionCreate()
{
...
}
For create action I can make CURL…

delux
- 1,694
- 10
- 33
- 64
2
votes
0 answers
Update Wizard (Entity Framework) - VSS 2008 not updating view. Should I manually update it?
I am using VSS 2008 and built a Entity Framework model from SQL server 2008 database. Everything worked fine. Now I have updated a view to include a new column and tried refreshing the entire model from DB but the updated column in the view is not…

Pritika
- 101
- 1
- 3
- 11
2
votes
1 answer
Updating variable through model Backbone
I have a base model, that is creating a view with several div's. It is not actually a form; but it is acting as a form. I have variables being set with defaults as well. Here's my model right now:
var BaseModel = require('base-m');
var SomeModel =…

hiquetj
- 410
- 1
- 8
- 23
2
votes
3 answers
ASP.NET MVC 2 UpdateModel() is not updating values in memory or database
I am new to MVC, and so am working through the NerdDinner tutorial, here. In particular, I'm running into problems with the use of the UpdateModel method, which is explained in the part five of that tutorial. The problem is, when I try to edit the…

campbelt
- 1,573
- 5
- 27
- 43