Use ControllerContext.IsChildAction
. This returns true if RenderAction was used.
if (!ControllerContext.IsChildAction)
{
// We were called via the URL and not via a [Phil Haack's blog][1]) call.
}
See Phil Haack on MVC2 RenderAction and Action.