I create a helper and i want to get view's path in this helper code, How can i do that?
I try code below. It will use view that return from action. So If i use this helper in partial view it will get parent view name instead.
RazorView view = helper.ViewContext.View as RazorView;
viewPath = view.ViewPath;
Thank you in advance.
string path = helper.ViewDataContainer as WebPageBase).VirtualPath;but its not very elegant and you would have to parse the value