作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有
@Html.ActionLink("Remove 1034, 1035, 1036", "RemoveSelected")
@Html.ActionLink(ViewBag.RemoveSelectedTitle, "RemoveSelected") //this is not work
// GET: /TabMaster/
public ActionResult Index()
{
ViewBag.RemoveSelectedTitle = "100,101,102";
return View(_tabmasterService.GetTabMasterList(10, 1));
}
最佳答案
您需要将 RemoveSelectedTitle 转换为字符串。当您使用 Viewbag 时,这是一个动态对象,并且不知道 RemoveSelectedTitle 是一个字符串。你的 ActionLink 应该是这样的:
@Html.ActionLink((string)ViewBag.RemoveSelectedTitle, "RemoveSelected")
关于asp.net - 如何从 Controller 设置@Html.ActionLink 的动态标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6292813/
我是一名优秀的程序员,十分优秀!