2012-08-23 1 views
0

ActionLink asp.net MVC 3에서 jquery 함수를 호출하는 방법?

actionlink에서 jquery 함수를 호출하는 방법. 내 this.href 결과 : "localhost : 54678/Customer? param = 1"하지만 this.href : "localhost : 54678/Customer/EditCustomer /? param = 1" 고객이 컨트롤러이고 EditCustomer가 동작입니다.

JQuery와 :


    $('#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" }) 
%> 

로컬 호스트 : 54678/고객/EditCustomer/PARAM = 1이 어떻게 호출하려면?

답변

1

어때?

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

%>

0

귀하의 ActionLink는 고객 컨트롤러의 색인 작업을 가리키고 있습니다. 다음과 같이 EditCustomer로 변경하십시오.

<%= Html.ActionLink(
      "Click", 
      "EditCustomer", 
    new { param = 1 }, 
    new { id = "mylink" }) 
%> 
관련 문제