MVC Redirect to View from jQuery with parameters

前端 未结 4 1955
谎友^
谎友^ 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 15:15

    redirect with query string

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

提交回复
热议问题