:
@Html.ActionLink(
"click me",
"project_module_functions_leftdisplay",
"ProjectRoles",
new {
parentid = options.parentid,
somethingelse = options.somethingelse
},
null
)
:
@Url.Action("project_module_functions_leftdisplay", "ProjectRoles", new
{
parentid = options.parentid,
somethingelse = options.somethingelse
})
또는 당신은 액션 링크 내에서 컨트롤러를 호출하는 경우
또는 당신은 HTML <form>
사용하는 경우 :
@using (Html.BeginForm("project_module_functions_leftdisplay", "ProjectRoles", new { parentid = options.parentid, somethingelse = options.somethingelse }))
{
...
}
을
또는 나는 당신의 질문을 오해하고 options
는 자바 스크립트 변수 :
<script type="text/javascript">
var options = ...
var url = '@Url.Action("project_module_functions_leftdisplay", "ProjectRoles", new { parentid = "__parentid__", somethingelse = "__somethingelse__" })';
url = url
.replace('__parentid__', encodeURIComponent(options.parentid))
.replace('__somethingelse__', encodeURIComponent(options.somethingelse));
// ... use the url here
</script>
뿐만 아니라 다른이있을 수 있습니다 경우, 정확한 시나리오와 당신이 달성하려고에 따라 더 나은 방법.