I need to create a function that is only necessary inside one cshtml file. You can think of my situation as ASP.NET page methods, which are min web services implemented in a
If you want to access your page's global variables, you can do so:
@{ ViewData["Title"] = "Home Page"; var LoadingButtons = Model.ToDictionary(person => person, person => false); string GetLoadingState (string person) => LoadingButtons[person] ? "is-loading" : string.Empty; }