I’ve been looking at the ASP.NET music store tutorial checkout process Part 9. unless I’ve missed something when the user checks out if they are not authorised they will be redirected to the standard ASP.NET MVC login page which is passed the return url i.e. the current checkout stage.
The user can then log in via the form after which they will be redirected to the correct checkout step or register a new account by clicking on an action link. If the latter is chosen the return url is lost and the user is redirected to the home/index. What would be the best way of alerting the account/register post action that the user came from the checkout process and return to next stage instead of the home/index.
You could either append your own “ReturnUrl” parameter or have a look at the URL referrer (=>
Request.UrlReferrer).