I've written an abstract class PaymentMethod and 2 derived classes, PaymentMethodInvoice and PaymentMethodBilling. For each of them I've written shared EditorTemplates.
The GET works fine, I select my PaymentMethod and get the right form. If I POST…
Given the following view model and action using the DefaultModelBinder, it seems to ignore the dictionary, but bind all other properties correctly. Am I missing something here? Looking at the MVC source code this seems legit.
Thanks
public class…
so i've got an array of numbers that i'm posting to an asp.net mvc action that has a list(of integer) parameter and it all works great.
my question is this:
Is it safe to assume that the list(of integer) will have the numbers in the same order…
ModelState Validation Culture on HttpPost
Error messages from ModelState not get localized
I have read these questions and they didn't solve my problem.
My problem: ModelState Validation errorMessages are always in English. Localization does not…
I use a jQuery plugin called jscroller, which uses jquery.ajax to make ajax calls.
I need to pass in all parameters from a search form, and deliver them to mvc controller, and I think the best way is to put in 'data' field the following…
I have the following:
This action:
public virtual ActionResult Search(string search, string sort)
{
...
}
Called from this url with empty query string parameters:
http://myurl.com/mycontroller/search?search=&sort=
Now my understanding was that as…
Let's say I have an interface like:
interface IThing {
int Id { get; set; }
string Title { get; set; }
}
And in ASP.NET MVC I have a form that posts to a controller action like this:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult…
I am working with the sample ASP.NET MVC 3 application. I am working on a proof of concept for an API for a project I'm working on, by sending log in requests using HttpWebRequests. I am submitting data as JSON and am using the Content Type…
I have a third party control that utilizes a single hidden input field to store a list of integers. This control is used throughout the site on numerous forms.
The submitted value (as displayed in Fiddler) is:
items=1,35,346,547
The controller…
I have made a custom binder for an abstract class. The binder decides which implementation to use.
It works well, but when I add a property which does not exist in the abstract class to a child class, it is always null.
Here is the code for the…
Morning/Afternoon/Evening all,
I'm pretty new to working within model binders and creating a custom model binder, so some things wont be clear to me.
I'm attempting to create a custom model binder in order to validate/review each string property…
I have a partial template that uses a User object as a model. The user has a collection of Accounts. On this partial template I have a loop as follows. The _Account partial template is bound to the Account class
@foreach (var item in…
i have the following model
public class Person
{
public int Id {get;set;}
[Required()]
public string Name {get;set;}
[Required()]
public Address Address {get;set;}
}
public class Address
{
public int Id {get;set;}
…
Given, routes are set up like below
For MVC : /entries/{entryID}/Children
For API: /api/entries/{entryID}/Children
The model I want the request to bind to is.
public class Entry
{
public int EntryID {get;set;}
public string…
I have a BaseViewModel that my View Models all inherit from.
public class MagazineViewModel : BaseOutputViewMode
{
public string TitleOfPublication { get; set; }
}
In my controller I use a factory method to give the corret View Model back…