asp.net mvc - How to get the action name from which the user redirected to the current action in MVC4 -
i have 2 actions named 'abc' , 'def' in home controller. action 'abc' returns redirecttoaction("def"). can name of action in 'def' redirection triggered.
public actionresult abc() { //some code return redirecttoaction("def"); } public actionresult def() { //some code string str = "you have been redirected action 'abc'"; return content(str); } how can name abc in action def ?
you can use request.urlreferrer referring url or request.servervariables dictionary, request.servervariables["http_referer"]
Comments
Post a Comment