How to call a function written in one controller from another controller in mvc
<p>I have 2 controllers called LoginController and RegisterController  and a function 'public static string Encrypt(string toEncrypt, bool useHashing)' is defined in RegisterController.How can I call the same from LoginController?</p>

<p>I used <code>var result= new RegisterController().Encrypt(newpass, true);</code> code but results :
Error   4   Member 'AP.WebApp.Controllers.RegisterController.Encrypt(string, bool)' cannot be accessed with an instance reference; qualify it with a type name instead  </p>