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"> </span>