How to set the returnURL manually when using Ajax.ActionLink
- by Roge
I have this link
@Ajax.ActionLink("create poll question", "CreatePoll", new { id = Model.DebateID }, new AjaxOptions
{
UpdateTargetId = "poll-entry-box",
InsertionMode = InsertionMode.Replace,
HttpMethod = "GET"
})
which is pointing at a action with the [Authorize] Attribute. The login works, but the returnURL is empty so it just redirects to the index page.
Is there some way to manually set the returnURL ?
NOTE
I am using the method described here http://haacked.com/archive/2011/10/04/prevent-forms-authentication-login-page-redirect-when-you-donrsquot-want.aspx because the login page was loading inside my partial.