Display partialview when clicking a link

后端 未结 2 407
情书的邮戳
情书的邮戳 2021-01-26 01:06

I\'m fairly new to JQuery and MVC 2 which makes this a bit harder, I\'ve always used WebForms before.
I\'m using the NerdDinner example as setup (I\'ve switched Dinner

2条回答
  •  误落风尘
    2021-01-26 01:40

    Ignore the Ajax helpers, they're for ASP.NET AJAX scripting.

    Change your link to:

    <%= Html.ActionLink("Details", "Details", new { id = item.id})%> 
    

    And your jQuery to:

        $('tr').click(function() {
            var url = jQuery(this).find('a').attr('href');
            $("#details").load(url)
        });
    

提交回复
热议问题