Assuming you are calling this from a controller, I guess you'd have to pass it in as a parameter to the ViewExists method. Or alternatively move the code to a base controller that all your controllers inherit from?
If you are calling it from outside of the context of a controller though... not sure - I guess you'd need to be using FileExists and check for the file name on disk?
Checking if view exists MVC?
How would I check if a view exists?
I have a helper library with static methods, so far I have below, how do I pass the ControllerContext into this?
Assuming you are calling this from a controller, I guess you'd have to pass it in as a parameter to the ViewExists method. Or alternatively move the code to a base controller that all your controllers inherit from?
If you are calling it from outside of the context of a controller though... not sure - I guess you'd need to be using FileExists and check for the file name on disk?
Does that help?
Andy
is working on a reply...