ASP.NET MVC > Views - Razor Engine

Calling external method in ASP.NET MVC

How to call external method in the razor view?


To call external method defined in the C# class, we can start calling them by giving their fully qualified name (if the namespace is not imported using @using statement). 

<p> 
 @MVCTraining5.Utility.LogError.GetDate()
 </p>

Here, we are assuming that we have a static method GetDate() definiend in the LogError class that is in MVCTraining5.Utility namespace. 

 Views: 19808 | Post Order: 20



Write for us






Hosting Recommendations