0

如何从 actionlink 调用 jquery 函数。我的 this.href 结果:“localhost:54678/Customer?param=1”但我需要 this.href:“localhost:54678/Customer/EditCustomer/?param=1”客户是控制器,EditCustomer 是操作。

查询:


  $('#mylink').click(function (e) {
            jQuery('#dialog').dialog('open');
            var iframe = $('#frame');
            alert(this.href);
            $(iframe).attr('src', this.href);

            e.preventDefault();
        });

看法:



  <%= Html.ActionLink(
             "Click",
             "Index",
    new { param = 1 },
    new { id = "mylink" })
%>

localhost:54678/Customer/EditCustomer/?param=1 这个怎么调用?

4

2 回答 2

1

这个怎么样?

<%= Html.ActionLink( 
         "Click", 
         "EditCustomer",
new { param = 1 }, 
new { id = "mylink" }) 

%>

于 2012-08-23T11:20:42.500 回答
0

您的 ActionLink 指向 Customer 控制器的 Index 操作。将其更改为 EditCustomer,如下所示:

<%= Html.ActionLink(
             "Click",
             "EditCustomer",
    new { param = 1 },
    new { id = "mylink" })
%>
于 2012-08-23T11:24:41.830 回答