How can I get the current view name regarding to current URL, in asp.net MVC 3 using Razor engine?
ASP.NET Core's equivalent:
@ViewContext.ExecutingFilePath
Output is like this:
/Views/Shared/String.cshtml
The rendering of a view may involve one or more files (e.g. _ViewStart, Layouts etc). This property contains the path of the file currently being rendered.
ViewContext.ExecutingFilePath Property