Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 2 使用';标题';MVC2中ActionLink中的标记_Asp.net Mvc 2_Jquery Ui - Fatal编程技术网

Asp.net mvc 2 使用';标题';MVC2中ActionLink中的标记

Asp.net mvc 2 使用';标题';MVC2中ActionLink中的标记,asp.net-mvc-2,jquery-ui,Asp.net Mvc 2,Jquery Ui,在一篇题为“以下代码片段”的文章中: <li><%= Html.ActionLink("Home", "Index", "Home", new { title="Home Page" }, null)%></li> thx如果要在生成的html锚上设置title属性,则应反转参数。不要被routeValue和htmlAttributes参数所迷惑 <%= Html.ActionLink("Home", "

在一篇题为“以下代码片段”的文章中:

     <li><%= Html.ActionLink("Home", "Index", "Home", 
                  new { title="Home Page" }, null)%></li>

thx

如果要在生成的html锚上设置
title
属性,则应反转参数。不要被
routeValue
htmlAttributes
参数所迷惑

<%= Html.ActionLink("Home", "Index", "Home", 
    null, new { title = "Home Page" }
)%>

如果您想将title作为查询字符串参数传递,那么您的代码就可以了

您获得异常的原因与
Html.ActionLink
帮助程序无关,而是在其他地方。

我希望这将有助于:

@Html.ActionLink("Link with icon and title ", "Method", "Controller", new { id = ViewBag.Id, order = 2 }, new { @class = "glyphicon glyphicon-star", @Style = "text-decoration:none", @title = " my title" })

Thankx-我正在处理的示例是对这些字符串进行硬编码,而不是在查询字符串中传递它们。他显然有意按照所示的顺序排列参数(UL中的其他项的结构相同),但可能我缺少了一个Include-我在使用他的代码时遇到语法错误-在使用您的代码时没有声明“null”。还有其他想法吗?
@Html.ActionLink("Link with icon and title ", "Method", "Controller", new { id = ViewBag.Id, order = 2 }, new { @class = "glyphicon glyphicon-star", @Style = "text-decoration:none", @title = " my title" })