.net mvc 使用html.actionlink 时,怎么实现target="_blank"?

.net mvc 使用html.actionlink 时,怎么实现target="_blank"?


开满天机
浏览 264回答 3
3回答

郎朗坤

Html.ActionLink("linkText","actionName",routeValues,htmlAttributes)htmlAttribute可以设置<a>标签的属性,如 Html.ActionLink("detail","Detail",new{id=1},new{ target="_blank"})会生成 <a href="Products/Detail/1" target="_blank">detail</a>

素胚勾勒不出你

<%:Html.ActionLink("通讯录", "call", "callAction", new { classes = "customer", method = "query", nextPage = "customer.aspx" }, new { target = "right" }) %>
打开App,查看更多内容
随时随地看视频慕课网APP