【发布时间】:2017-08-02 03:31:16
【问题描述】:
我的视图中有此代码。这很好用。
... onclick="location.href = '@Url.Action("Plan", "Care", new {Area = "HomeC"})'"><img src="~/Content/images/dash/Care.PNG"
如何使用 Html.Raw 执行相同的代码? 我试过这个
grid.Column(columnName: "Name", header: "", format: @<text>@(item.ListStatus == 1 ? Html.Raw("<button class='btn btn-default btn-plan' title='Care' onclick='location.href = " + "'" + Url.Action("Plan", "Care", new {Area = "HomeC"}) + "''>" +
"<img src='/Content/images/dash/Care.PNG' class='img-plan' data-interlocutorid=" + item.UserId + " " + "data-interlocutorname=" + item.Name + " " + ">" +
"</button>") : Html.Raw(""))
</text>),
图片一切正常,但链接不起作用。
【问题讨论】:
-
你想做什么?
-
我编辑我的代码。请看。
标签: asp.net asp.net-mvc asp.net-mvc-4 asp.net-mvc-3