I have controller "Account", in which there is an action "UploadImage". This action can called from another actions.
I'm calling this action from another action "AddProduct" from "Product" Controller using Jquery.
Now what I want, Whenever my UploadImage action is invoked, I want to know the requesting controller or action name in UploadImage.
Like If I'm calling that action from AddProduct then, in UploadImage, ActionName name should be AddProduct.
I have done this
string actionName = this.ControllerContext.RouteData.Values["action"].ToString();
string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
But This is always giving me
actionName : UploadImage
controllerName : Account
Solution 1 : I have option to pass the action name in ajax call but i don't want to do that. I want to get It In server side.