>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()