1.html.ActionLink返回的指向指定controller、指定action的超鏈接標簽<a>標簽.如果沒有指定controller,則默認為本頁面對應的Controller.
如@Html.ActionLink(“鏈接文本”、“someaction”、“somecontroller”,new { id = " 123 " },null)
生成:
< a href = " / somecontroller / someaction / 123 " >鏈接文本</a>
2、Html.Action可以執行一個控制器的action,並將返回結果作為html string。
3.Url.Action返回的是指定控制器指定action的完整URL地址,不含<a>標簽
用法:
<form name="form1" action="<%:Url.Action("Reply","LatestJoinCompany") %>" method="post">
<a href="<%:Url.Action("SelectDetail","OutBox",new{letterid=m.LetterID}) %>"><%=m.LetterTitle %></a>
說明:
<%:Url.Action("SelectDetail","OutBox",new{letterid=m.LetterID}) %>
返回/OutBox/SelectDetail?letterid=m.LetterID