Questions tagged [modelbinder]

61 questions
0
votes
1 answer

how to use model binder to post data from a form + value of a span to data base

Good time. I'm new in Asp.net-MVC . I have a form which it gets data from user and there is a span in this page which I want to post data of inputs and value of span to my data base. I wanted to use model binder but I don't know how to name spans…
neda Derakhshesh
  • 1,103
  • 2
  • 20
  • 43
0
votes
0 answers

ModelBinder is not working after adding explicitly arguments to Html.BeginForm()

In controller I obtain StudentID from POST method from a View. Basically the line is: public ActionResult Edit(int? StudentID) {} In the View, I have a hidden field to provide the StudentID. What would be the reason that in View() when I changed…
Celdor
  • 2,437
  • 2
  • 23
  • 44
0
votes
2 answers

.Net Model binding a dataset via JSON post

I am having a heck of a time with this one. I must be missing something. I am posting a complex model via Angular/JSON to a .NET controller. When posting it back to the server the DefaultModelBinder only partially binds to the model (the simple…
brianc
  • 455
  • 2
  • 21
0
votes
0 answers

ModelBinder does not set correct original values

Note Solved this has been edited More information check the edits When performing a post back with an entities model in MVC. The model binder neglects to bind the original values. So if anyone is using a derivative of save changes to audit log…
johnny 5
  • 19,893
  • 50
  • 121
  • 195
0
votes
1 answer

Date / Time Model Binder

I already followed every step in the following tutorial but got some problem. My purpose is to use model binder to bind date and time and then save in a datetime field.…
user3618052
  • 65
  • 1
  • 1
  • 5
0
votes
1 answer

When is the DefaultModelBinder invoked within the ASP.NET Pipeline?

I want to know when the DefaultModelBinder is invoked within the ASP.NET Pipeline? Background: I want to find an approriate place where I can set the cultures of the current thread.
Rookian
  • 19,841
  • 28
  • 110
  • 180
0
votes
2 answers

Model binder wont pass checkbox value into integer property

My user model has an int property called active (its an int because I didn't create the model nor the database, its getting used as a boolean..). I'm creating the action /Users/Edit/ that will be editting the model, so I've got a form with a…
user1534664
  • 3,258
  • 8
  • 40
  • 66
0
votes
1 answer

backbone modelbinder converter ajax request

Does anyone know how to cause modelbinder's converter to wait until a ajax request is complete? I'm trying to use backbone's modelbinder on my view but the converter is failing because it is not waiting for the ajax call to complete before…
0
votes
1 answer

MVC default model binding to complex list

I'm having some trouble binding to a nested list with the default binder. I am using linq to sql and have the following data structure Competition < CompetitionQuestions < CompetitionQuestionChoices my html is as follows <%=…
Joe
  • 83
  • 6
0
votes
2 answers

Asp.net MVC. Duplicate name in EditorTemplate or in @Html.Action / Partial

After searching a lot on this problem, i'm askin help to the community : I'm doing somthing like that in a View (The problem is the same if i'm using @Html.Action or a PartialView @for(int i= 0; i< Model.Contacts.Count(); i++) { …
Eric Gontier
  • 131
  • 1
  • 5
0
votes
1 answer

Can I bind a select box option text to a model using Backbone.ModelBinder?

I have an edit form set up in my Backbone app that populates with model data. I currently have it working without ModelBinder but want to switch over to ModelBinder. I have a select box where the value maps to an id in the model, and the selected…
Bonnie V.
  • 203
  • 2
  • 8
0
votes
1 answer

MVC Model binder list Id and Name issue

Hi I have a problem with getting correct ID's and Name when I use ajax-calls to get partials views. I want ids like "Blocks_0__Items_0__Id" . These are rendered using for loops so Main page: @for (int blockIndex = 0; blockIndex <…
Todilo
  • 1,256
  • 3
  • 19
  • 38
0
votes
1 answer

MVC3 NuGet PagedList form data

I created a model that has 2 properties, a pagedlist of selectable templates and a paged list of selectable versions. The idea is that the view will allow you to select multiple versions and templates so that when you post the form it will create…
Csharpfunbag
  • 395
  • 3
  • 19
0
votes
2 answers

Active filter for backbone.js collections

I have a little problem with my backbone collection. I just want to display 6 models, and always the latest 6. I use CollectionBinder (Backbone.ModelBinder) to render and display my collections and I use RailsFayeSubscriber to sync them with the…
jonepatr
  • 7,769
  • 7
  • 30
  • 53
0
votes
1 answer

How can i prevent some values from being updated if i am passing an object to the model binder

I have an object named Visit with the following properties:- Note DoctorID VisitTypeID CreatedBy Date VisitID PatientID StatusID Timestamp In the Edit view the user can only edit the following two properties :- Note DoctorID So i have added the…
John John
  • 1
  • 72
  • 238
  • 501