HI WELCOME TO KANSIRIS

MVC Redirect to View from jQuery with parameters

Leave a Comment
If your click handler is successfully called then this should work:

$('#results').on('click', '.item', function () {
            var NestId = $(this).data('id');
            var url = "/Artists/Details?NestId=" + NestId; 
            window.location.href = url; 
        })

Here is the function on the Controller:

public ActionResult Details(string NestId)
    {
        ViewBag.NestId = NestId; 
        return View();
    }

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.