How can I disable client validation for some fields in asp.net MVC -
how can disable client validation fields in asp.net mvc. have not defined validation order property show "the order field required" in client. want disable client validation order.
public class product { ... [required(errormessage = "name required")] public string name { get; set; } public int order { get; set; } ... }
int
non nullable
type. cannot assigned empty value, metadata provider automatically makes required. if business doesn't need order
field filled in product
class, make nullable type - nullable<int> order
. way won't made required unless explicitly make it. well, there way - using scripts on client side. disable validation on client side, after post server, error message still appear unless make nullable
. assuming use default jquery validation plugin asp.net mvc 3, can use remove rules function
Comments
Post a Comment