RedirectToAction not redirect

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.

This entry was posted in Codes & Scripts and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>