asp.net-mvc-2-validation Questions
4
Solved
I am checking my database in Create(FooViewModel fvm){...} to see if the fvm.prop1 and fvm.prop2 already exist in that combination; if so, I want to add an error to the modelstate, then return the ...
Bondy asked 21/4, 2011 at 4:0
10
Solved
I have some problem with Html.ValidationSummary. I don't want to display property errors in ValidationSummary. And when I set Html.ValidationSummary(true) it does not display error messages from Mo...
Cardoza asked 12/5, 2010 at 11:15
9
Solved
In my web application I am validating the url from glabal.asax . I want to validate the url and need to redirect to an action if needed. I am using Application_BeginRequest to catch the request eve...
Phip asked 16/8, 2011 at 10:40
6
I have a registration form on which I use client side validation (Required, StringLength etc. specified on my view model). The form is currently pretty much how the scaffolder creates it:
@using (H...
Aslant asked 1/3, 2011 at 4:33
2
Solved
How do you get a model's validation to also validate child objects in a generic list property.
I have a model that I'm trying to validate, this is not what's being posted to the server, but a comp...
Lulualaba asked 16/12, 2010 at 21:13
5
Solved
I have this classes:
public class GroupMetadata
{
[HiddenInput(DisplayValue = false)]
public int Id { get; set; }
[Required]
public string Name { get; set; }
}
[MetadataType(typeof(GrupoMeta...
Suitcase asked 31/3, 2010 at 18:56
2
Solved
I have separate model and viewmodel classes. Where viewmodel classes only do UI level validation (refer: Validation: Model or ViewModel).
I can verify on post action in a controller that model (ve...
Arapaima asked 24/6, 2011 at 14:51
3
Solved
There's a way to set the default resource to the data annotations validations?
I don't wanna make something like this:
[Required(ErrorMessage="Name required.", ErrorMessageResourceType=typeof(Cus...
Martres asked 15/7, 2010 at 23:4
4
Solved
What approach do you recommend for validating a DateTime on the client side in MVC?
Let's say I have a model with a property named DateOfBirth that is a DateTime, like so.
public class UserModel
...
Cryptozoic asked 14/8, 2010 at 21:41
2
Solved
I'm decorated a ViewModel in my ASP.NET MVC 2 site with System.ComponentModel.DataAnnotations validation attributes. For one of my fields, named Price, I want to validate that the value is not belo...
Gael asked 4/7, 2010 at 22:44
1
I'm trying to validate a model containing other objects with validation rules using the System.ComponentModel.DataAnnotations attributes was hoping the default MVC implementation would suffice:
va...
Normi asked 9/6, 2010 at 13:58
3
Solved
I have a model like this:
public PurchaseOrder
{
[Required] [StringLength(15)]
public virtual string OrderNumber {get;set;}
// etc.
}
When I submit an order from the view (using $.post, not...
Dematerialize asked 8/5, 2010 at 1:38
1
© 2022 - 2024 — McMap. All rights reserved.