T4MVC Html.ActionLink 或 Html.RouteLink - 如何添加目标
我有一个正在工作的 Html.RouteLink,我想将其转换为 T4MVC。
工作 RouteLink 代码如下:
<%= Html.RouteLink(vaultViewItem.NameDisplay,
new {controller = "Entity",
action= "Index",
dataType = vaultViewItem.VaultID},
new { target="vaultIFrame"}) %>
直接转换 RouteLink 根本不起作用 - 结果 URL 包含 RouteValueDictionary 类名,而不是各个字典项。
我尝试将 Html.ActionLink 与 T4MVC 一起使用,链接可以正常工作,但目标从未被选中。 (有效链接,但发送到 _self 而不是指定目标。)
<%= Html.ActionLink(vaultViewItem.NameDisplay,
MVC.Entity.Index(vaultViewItem.VaultID).AddRouteValues(
new {target = "vaultIFrame"})) %>
如何在所需的 iFrame 中显示链接页面?
I have a working Html.RouteLink that I want to convert to T4MVC.
The working RouteLink code is as follows:
<%= Html.RouteLink(vaultViewItem.NameDisplay,
new {controller = "Entity",
action= "Index",
dataType = vaultViewItem.VaultID},
new { target="vaultIFrame"}) %>
Converting the RouteLink directly does not work at all - the resultant URL contains the RouteValueDictionary class name, rather than the individual dictionary items.
I have tried to use the Html.ActionLink with T4MVC and the link will work fine, but the target is never picked up. (Valid link, but sent to _self rather than the stated target.)
<%= Html.ActionLink(vaultViewItem.NameDisplay,
MVC.Entity.Index(vaultViewItem.VaultID).AddRouteValues(
new {target = "vaultIFrame"})) %>
How can I display the linked page in the desired iFrame?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try this: