MVC Redirect to View from jQuery with parameters

前端 未结 4 1936
谎友^
谎友^ 2021-02-05 14:48

I have seen some posts relating to this but can\'t seem to get it to work. With the redirect I get a \'resource cannot be found error\'.

I am trying to redirect to a De

4条回答
  •  悲&欢浪女
    2021-02-05 14:57

    This would also work I believe:

    $('#results').on('click', '.item', function () {
                var NestId = $(this).data('id');
                var url = '@Html.Raw(Url.Action("Artists", new { NestId = @NestId }))';
                window.location.href = url; 
            })
    

提交回复
热议问题