In a master / detail scenario, I use an Edit ActionLink that fetches the partial details view via a jQuery Ajax call; pretty typical, right?
The problem I've come across is when a user's auth token expires and he clicks on the Edit ActionLink. The returnUrl parameter of the LogOn action is being set by the ActionLink that returns the partial view, and upon successful authentication, a big white screen with only the partial view is shown.
This actually applies to any of the many Ajax action links that return partial views--anytime one of them triggers a redirect to the LogOn action due to an expired authentication ticket.
[HttpPost]
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
if (ModelState.IsValid)
{
if (MembershipService.ValidateUser(model.UserName, model.Password))
{
FormsService.SignIn(model.UserName, model.RememberMe);
if (!String.IsNullOrEmpty(returnUrl))
{
return Redirect(returnUrl);
}
.....
Of course the return Redirect(returnUrl);
is the problem here.
I'm wondering how other people deal with this scenario.
Thanks.