Questions tagged [remote-validation]

Remote Validation is the ability to call a custom server-side validation method via the client-side.

159 questions
26
votes
1 answer

how to use multiple AdditionalFields in remote validation - asp.net mvc

I need to validate the duplicate of FirstName, LastName and Email Address combination using remote validation in my ASP.NET MVC 4 (C#) application. The Remote Validation accepts only one AdditionalFields, which is as below: …
Prasad
  • 56,343
  • 61
  • 142
  • 199
24
votes
6 answers

MVC 5 Remote Validation

I need to validate an input field value from user before the form is submitted. I have created an action in my custom controller and decorated the field with it: action name: CheckValue controller name: Validate [Remote("CheckValue",…
user2818430
  • 5,195
  • 15
  • 63
  • 133
16
votes
4 answers

Multiple fields validation using Remote Validation

I have the following model: public class Customer { public string FirstName {get;set;} public string LastName {get; set;} [Remote("CardExisting", "Validation", AdditionalFields="FirstName,LastName") public string CardNumber {get;…
Guy Z
  • 671
  • 2
  • 7
  • 20
10
votes
1 answer

Forcing a revalidate on mvc3 unobtrusive remote validation

It's a classic login flow. The user can choose between 'new user' or 'existing user'. If the user is new, the name in the login box should validate against the server to see if the username is unique, if it's an existing user this check will be…
7
votes
5 answers

How to get unobtrusive jquery remote validator to perform async..?

In an MVC3 app, using jquery unobtrusive validation, and a view/model with a [Remote] validator: I am trying to disable the submit button and display a wait icon during remote validation, and when a valid form is submitted to the server. I thought I…
7
votes
4 answers

Remote Attribute Validation not firing in Asp.Net MVC

Here is my model code public class BlobAppModel { [Required(ErrorMessage="Please enter the name of the image")] [Remote("IsNameAvailable","Home",ErrorMessage="Name Already Exists")] public string Name { set; get; } } And in my…
Bharat Bhushan
  • 1,175
  • 3
  • 15
  • 24
6
votes
1 answer

Remote Validation OnBlur and Empty String

I have a view model with remote validation enabled. In my view I also disabled OnKeyUp $(function() { $.validator.setDefaults({ onkeyup: false }); }) But if I focus on the text box, and move the focus to another control the remote…
hardywang
  • 3,996
  • 7
  • 54
  • 88
6
votes
4 answers

MVC Remote validation, parameter is null

public class UserModel { public LogOnModel LogOnModel { get; private set; } public RegisterModel RegisterModel { get; private set; } } in my RegisterModel I have email address like…
Pacman
  • 1,955
  • 2
  • 32
  • 64
5
votes
2 answers

RazorPages Page Remote not working on model

as per https://www.mikesdotnetting.com/article/343/improved-remote-validation-in-razor-pages I followed the tutorial and implemented the PageRemote. However it does not work if applied to a property of a model and I use the model as property.…
Jackal
  • 2,627
  • 14
  • 37
5
votes
2 answers

How can I reuse a remote validation method when the parameter name needs to be different?

I have two classes I'm using as the model of two different views. You can see that the second class contains an instance of the first. The first contains Remote validation attributes. [MetadataType( typeof( ExceptionLogModel.EmailRecipientMetadata )…
Glazed
  • 1,788
  • 15
  • 19
5
votes
2 answers

Same Remote Validation for 2 different properties in a model

I have 2 properties contractor1 and contractor2 in a model, how can I use a single remote validation for both of them [Display(Name ="Contractor 1:")] [Remote("ValidateContractor", "Contracts")] public string Cntrctr1 {get; set;} [Display(Name =…
CoderUnknown
  • 103
  • 3
  • 13
5
votes
2 answers

How to Remote validate email or check if email exists

I am trying to check if Email exists at registration so that there are no duplicate emails in the database. I am doing this with the MVC4 default Internet Application but i have added an Email field to the RegisterviewModel. I also noticed that,…
Komengem
  • 3,496
  • 6
  • 31
  • 56
5
votes
5 answers

ASP.NET MVC RemoteAttribute validation not working - Action not being executed

I've been pulling my hair out trying to figure out why ValidationController actions are not being triggered. I have settings enabled in project-wide web.config:
5
votes
2 answers

Event hooks for MVC unobtrusive remote validation

Is there a way to hook into MVC3 unobtrusive remote validation on the client, before data is submitted to the remote method, and after a result is returned from the remote method? I am trying to tell a remote validator to only perform validation if…
4
votes
3 answers

ASP.NET MVC 3: model-level client-side or remote validation

I need to do some model-level validation in an MVC 3 edit page. (To be specific, I need to confirm that either Field A or Field B is filled in, but not both and not neither.) I want to perform client-side validation as well as server-side…
Ann L.
  • 12,802
  • 5
  • 30
  • 60
1
2 3
10 11