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 6106583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:05:43+00:00 2026-05-23T14:05:43+00:00

I have a Solution under the solution there is few Projects one of the

  • 0

I have a Solution under the solution there is few Projects one of the called DomainModel,
in which i write my models and other stuff mainly infrastructure.

Now i have another project called WebUI in which i do my UI (Views, Controllers , etc…)

I want to use Remote attribute in DomainModel project which must implemented in WebUI certain view.

When i use it in DomainModel it’s gives me an error, that it does not recognize the Controller and it’s correct it does not recognize it because the if I add the reference of WebUI the Vs begin to swear at me because it will be a circular reference.

How to implement this?

this is my code
Controller that serves the RemoteValidation

[OutputCache(Location = OutputCacheLocation.None, NoStore = true)]
public class RemoteValidationController : Controller
{
    public JsonResult CheckPassword(string SmsCode)
    {
        return Json(12345, JsonRequestBehavior.AllowGet);
    }
}

//The real entity in DomainModel project

public class SmsCustomer
{
    public int CustomerId { get; set; }
    public string Cli { get; set; }
    //this is what i have to validate on server
    public virtual string SmsCode { get; set; }

    public DateTime InsertDate { get; set; }
    public int CustomerDaysChoiceId { get; set; }
    public int CustomerAmountChoiceId { get; set; }

    [Required(ErrorMessage = "error")]
    [StringLength(128, ErrorMessage = "error")]        
    public string SelectedWords { get; set; }
    public SmsCustomerDaysChoice CustomerDaysChoice { get; set; }
    public SmsCustomerAmountChoice CustomerAmountChoice { get; set; }
}

this is my entity after i extend it with the remote attr in WebUI.Models

 public class Customer : SmsCustomer
    {
        [Required(ErrorMessage = "Error required")]
        [StringLength(9, ErrorMessage = "Error length")]
        [Remote("CheckPassword", "RemoteValidation", ErrorMessage = "Error  remote")]
        public override string SmsCode { get; set; }
    }

this is my view

@Html.TextBoxFor(c => c.SmsCode)
//error span
<span class="checkbox-form-error" data-valmsg-for="SmsCode" data-valmsg-replace="true">&nbsp;</span>
  • 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-05-23T14:05:43+00:00Added an answer on May 23, 2026 at 2:05 pm

    The remote validation stuff is very specific to the WebUI project.

    Because of this, I’d create a View model that inherits from the actual class, and then override the property that needs remote validation. Then you should be able to specify the controller/action for remote validation.

    You can also put your validation in a class of its own, like ScottGu demonstrates here:
    http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx

    (Look down the post, before the last step)

    Also take a look at this: Adding DataAnnontations to Generated Partial Classes

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a solution with many projects. One project contain few custom components. One
I have a solution with several projects. One of them is a setup project.
I have a solution consisting of five projects, each of which compile to separate
I have a solution with other 70 projects into it. My question is :
We have a Visual Studio 2008 solution under VSS source control. The solution contains
I have a solution with several projects, where the startup project has a post-build
I have a solution in Visual Studio 2005(professional Edition) which in turn has 8
I have this solution for a single button: myButton.Attributes.Add(onclick, this.disabled=true; + GetPostBackEventReference(myButton).ToString()); Which works
I have a solution with multiple projects and we need to do some serious
I have had the problem a few times now while working on projects and

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.