locked
How To Access A Custom Class Function In a View RRS feed

  • Question

  • User1349647816 posted

    How do access a custom class function from a view, it is a static class

    Saturday, August 22, 2020 9:08 AM

All replies

  • User475983607 posted

    How do access a custom class function from a view, it is a static class

    This is a fundamental C# syntax question.  I recommend book marking the C# Programming Guide; https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-classes-and-static-class-members

    @Namespace.ClassName.Method();

    Saturday, August 22, 2020 12:34 PM
  • User1349647816 posted

    Thanks I know all this but what I am asking is the real based scenario of calling one of my functions from a static class in my razor vieww

    Sunday, August 23, 2020 9:49 AM
  • User475983607 posted

    ShatterStar

    Thanks I know all this but what I am asking is the real based scenario of calling one of my functions from a static class in my razor vieww

    Calling a static method is very simple and extremely common..  For example all the HTML helpers are static method.

    Share the code you are struggling with.  Explain the expected results and the actual results when running the code.  This will help us to help you.

    Sunday, August 23, 2020 10:36 AM