Tuesday 16 February 2021

MVC - Fix Error - The type or namespace name 'RemoteAttribute' could not be found

 Watch this example on YouTube


 

The type or namespace name 'RemoteAttribute' could not be found (are you missing a using directive or an assembly reference?)   

The type or namespace name 'Remote' could not be found (are you missing a using directive or an assembly reference?)  

The type or namespace name 'ErrorMessage' could not be found (are you missing a using directive or an assembly reference?)  


when 


        [Remote(action: "DoSomething", controller: "Home", ErrorMessage ="some error")]
        public string Name { get; set; }

To fix it add

    using System.Web.Mvc;


No comments:

Post a Comment