It starts here in the .ascx on a button click.
<script type="text/javascript">
function acceptG(id) {
jQuery.get('<%: Url.Action("Accept", "Gift") %>', { id: id });
}
</script>
Then, here is the Controller is where the RedirectToAction is:
[Authorize]
public ActionResult Accept(long id)
{
var result = _gtService.AcceptG(id, User.UserID);
if (result.Success)
return RedirectToAction("Index", "Magnets");
else
return View("InvalidG");
}
Here is the Index
public ActionResult Index()
{
ViewData["Count"] = _souvenirService.GetDataForUser(User.UserID).Count();
return View();
}
One thing to remember is when using the Menu and hitting this Index the page comes up successfully, so it does work. But when using the RedirectToAction it hits all the code but does not redirect. Any help is appreciated.