Q: How to get name of view from actionmethod in mvc5? I have a situation of rendering different GET view depending on different clients. But all these Get views are doing POST to same end point. I want to know which view is doing POST so that i can render calling view if there is error? 

A: Add a hidden input property to the model that you base the views on:
[HiddenInput]
public string Client { get; set; }

Then add it at the beginning of the form in all the views:
@Html.HiddenFor(m => m.Client)

Now, in the controller, you can assign the client value to the Client property when building the model in the GET action, and check it for the decision you want to make in your POST action.
UPDATE If you don't want to add an extra property to the model, you can use ViewBag to hold the value (though the model solution above is better). In the controller, you can assign the client value in the GET action:
ViewBag.Client = client;

Then add it at the beginning of the form in all the views:
<input type="hidden" name="Client" value="@ViewBag.Client" />

And then check it for the decision you want to make in your POST action. Since it is not part of your model, you'll have to get it separately:
public IActionResult PostAction(MyModel mode, string client) {
  switch(client) {
  //...
  }
}

Note: the method above, allows you to use the same view for more than one client, essentially allowing you to create a kind of client groups or types. But if you actually have a different view for each client, then you don't need to pass a value by ViewBag and you can hard code it directly in each view:
<input type="hidden" name="Client" value="Client1" />


A: The HttpMethod property on the HttpRequest object will get it for you. You can use this in your Controller:
using System.Net.Http;

if (HttpContext.Request.HttpMethod == HttpMethod.Post.Method)
 {
 // The action is a post method
 }

If you would like to find which View has called an action method, you can use the following in your Url.Action :
@Path.GetFileNameWithoutExtension(Server.MapPath(VirtualPath))

An example call could be:
@Url.Action("Action","Controller",new{callingView=Path.GetFileNameWithoutExtension(Server.MapPath(VirtualPath))})

You would need add a parameter to your controller method:
public ActionResult Action(MyModel model, string callingView)

You can read more about @VirtualPath here
