Hi Guys
I'm trying to do an asynchronous login. When the user is authenticated I want to redirect to the user's originally requested page. The problem is that the Action Method is returning a Redirect type of ActionResult and the jQuery doesn't seem to know what to do..
I'm using the following jQuery:
$("form").submit(function(event)
{
$.post($(this).attr("action"), $(this).serialize(), function(result)
{
}, "html"); // is this the right return type?
return false;
});
with this code on the server to handle the logon:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult LogOn(WAPConfigUser user)
{
if (ValidateLogOn(user.UserName, user.Password))
{
string redirect = "";
if (Request.QueryString["ReturnUrl"] != null)
{
redirect = Request.QueryString["ReturnUrl"];
return Redirect(redirect);
}
else
{
return RedirectToRoute("Default");
}
}
}
Can someone suggest how I can get this to work?
Thanks
Dave