Following is the exception stackify shows me on dashboard:
ERROR The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.
System.FormatException: The string was not recognized as a valid DateTime. There is an…
I have an Action like this:
Update([Bind(Prefix = "CurrentModel")] dynamic edited)
but when I use dynamic the ModelState.IsValid always returns true so it seems like there is no validation on the dynamic object? If not, how can I solve this?
I am using MVC 3 final RTM.
Given
This route:
context.MapRoute(
"Blog_Posts",
"Blog/Posts/{id}/{slug}",
new { controller = "Posts", action = "Index", slug = UrlParameter.Optional }
);
And on a post's page, e.g. /blog/posts/2/some-slug I…
I've tried to follow the answer by Darin Dimitrov on this post:
How to create controls dynamically in MVC 3 based on an XML file. But in ASP .NET Core (Specifically ASP .NET Core 2) there is no DefaultModelBinder so I have to modify the Custom Model…
I like to take sections of my view and break them out in to multiple partial views, and I like to only pass in the part of the model that partial view is interested in. Generally I like to put a model specifically for the partial as a property on…
I have been trying to figure this one out for the past 2 days...
My main model contains a property of type "dynamic" and looks like this:
public class WGTTestModel
{
private dynamic _oProp3 = null;
public WGTTestModel()
{
}
…
I have a form that I binding to that has the following structure:
public class Status
{
public List ABCAttachments_Files { get; set; }
}
public class Attachment
{
public string Id { get; set; }
}
public class ABCAttachment :…
Recently I've been working on a decently complex UI in which I've had to adjust the default collection binding to use a 1 based collection instead of 0 based which ends up with inputs like the following when using Html.InputFor():
I send post request and get in response body form data:
0[family]=Marco&0[name]=Polo&0[age]=66&1[family]=Family&0[name]=Name&0[age]=22
var formData = "0[family]=Marco&0[name]=Polo&0[age]=66&1[family]=Family&0[name]=Name&0[age]=22";
var data =…
I have a view with multiples forms, each one submit should submit a hidden field with a specific value and all of the share the same model. From my controller I set the value before rendering the view, but that value I will need it for one of the…
I'm getting a DateTime from an implicit binding at an Action in a .NET MVC web application. The problem is that i'm getting the date in format "MM/dd/yyyy" while i'm sending it through a query string with Ajax in format "dd/MM/yyyy".
I know this is…
I have researched all over the net but hopefully here someone can help me.
I have following ViewModel classes:
public class PersonEditViewModel
{
public Person Person { get; set; }
public List Interests { get; set;…
I'm having some trouble unit testing the model returned by DefaultModelBinder. I want to feed in a fake form collection and check the model that it returns to make sure model properties are being bound properly. In my research, I'm not turning up…
I'm developing a project using BDD/TDD techniques and I'm trying my best to stay the course. A problem I just ran into is unit testing the DefaultModelBinder. I'm using mspec to write my tests.
I have a class like this that I want to bind…
So if you post empty string to a controller like this
and try to bind it to a List very strange stuff occurs
Does anybody faced this issue?
Why it adds default int value to a list?