>>>>Hi Viv, just to clarify, I put
>>>>
>>>>ViewBag.Caller = Request.UrlReferrer; // in the HttpGet method for Edit ?
>>>>input type="hidden" name="caller" value="@ViewBag.Caller" // In the Edit.cshtml ( angle brackets remove for UT )
>>>>
>>>>
>>>>where do I then get access to this to do the Redirect - must be in the HttpPost method I guess ?, thanks for your help
>>>>
>>>>Edit
>>>>Sussed it, added string caller to the HttpPost Edit method, much better way thanks.
>>>
>>>If you're using a form you don't need to specifically add the caller - you could just access it on the server via : Request.Form["caller"]
>>>
>>>Also, if, for example, the View you wanted to return to was on the same controller you could just do:
string s = Request.Form["caller"];
>>>return View(s.Substring(s.LastIndexOf('/') + 1));
thus avoiding the Redirect()
>>
>>Probably don't want to avoid the redirect after posting the edit:
http://www.theserverside.com/news/1365146/Redirect-After-Post>
>I confess to being unsure whether that is relevant in this instance.
>
>
http://www.dotnet-tricks.com/Tutorial/mvc/4XDc110313-return-View()-vs-return-RedirectToAction()-vs-return-Redirect()-vs-return-RedirectToRoute().htmlHe wants to redirect to an Index view from the Edit's post. If he only returns the view:
1) The url still points to the Edit action.
2) A refresh of what is now an Index page (and should be GET request) will repost the edit.
3) The index view probably requires a different model than the edit view he is coming from.