Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8652963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:25:43+00:00 2026-06-12T14:25:43+00:00

I have a create user view (action) and apart from the clientside validations of

  • 0

I have a create user view (action) and apart from the clientside validations of certain field types, date, emailaddress etc i want to check that a couple for example emailaddress and username are unique by calling a couple of Server controlleractions.

I would have thought it preferable to “hook” into the existing MVC validation mechanisms to call these ajax functions. So that all when form validation occurs it calls my ajax validators, and restrospectively reflects this in the modelstate.isvalid, and on any errors are shown in the default html.validation helpers.

I was unsure if this is possible or if i needed to handle my own validation seperately? Currently i have created a couple of jquery functions which call a couple of controller actions and display the validity state of the username and emailaddress in a couple of spans i have added.

What is the best pattern with MVC? I thought about the possible method of wrapping each of the above fields in a seperate @Ajax.BeginForm(

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:25:45+00:00Added an answer on June 12, 2026 at 2:25 pm

    There is built in remote validation in Asp.Net MVC.

    In model:

    public class CreateUserModel 
    {
        [Remote("IsNameAvailable", "Validation")]
        public override string UserName { get; set; }
    }
    

    In controller:

    public class ValidationController : Controller 
    {
        public JsonResult IsNameAvailable(string Username) 
        {
            ... Do some checks
            return Json({some validation message here}, JsonRequestBehavior.AllowGet);
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my view I have: <?php echo $this->Form->create('User', array(controller => Users, action => login,
I have a partial view (user control) that is shared by my Create and
I have a view to create a user as follows. <% using (Html.BeginForm(SaveUser, Security))
I have the following code for my login view: <?php echo $session->flash('auth'); echo $this->Form->create('User',
I have a View with a <input type=submit value=Create /> when a User click
I have a action/view named: join And I post the the 'create' action. What
I have a User.create action that provisionally registers a new user and sends an
I have created a View which prompts the user to input some records with
i have created one login and register view in that view after login user
I have to create a user in a third party application that stores its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.