本文介绍了将CSS添加到HTML.ActionLink后,它不会导航到URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 亲爱的所有人, 当我在我的应用程序中向我的ActionLink HTML助手添加一个css类时,它不会导航到指定的URL,但是当我删除css类时它的工作方式完美无缺。一个与HTML.ActionLink一起使用的CSS类? 以下是我的代码: 1)当我写下面的代码时,它的工作原理完美。 @ Html.ActionLink(ICD9s,Index,EHR) 2)当我写下面的代码时,它不会导航到指定的URL。 @ Html.ActionLink(ICD9s,Index,EHR ,新{@class =linkbtnfull}) 谢谢解决方案 试试这个...... @ Html.ActionLink(链接名称, ActionName, ControllerName, null, new {@class =linkbtnfull} ) 您的代码应该是, @ Html.ActionLink(ICD9s,索引,EHR, null,new {@ class =linkbtnfull}) 指定发生哪种类型的错误或单击链接时会发生什么。 我的格式低于用于编写有效的行动链接: @ Html.ActionLink( ICD9s, 索引 , EHR, null , new {@ class = round} ) @ Html.ActionLink( ICD9s, 索引, new {Controller = EHR}, new {@ class = round}) 尝试使用_class =linkbtnfull代替@class =linkbtnfull 你的代码应该是, @ Html.ActionLink(ICD9s,索引,EHR,新{_class =linkbtnfull}) 希望这对你有用........ Dear All,When I add a css class to my ActionLink HTML helper in my application it doesn't navigate to the specified url but When I remove the css class it works perfect how can have a CSS class to go along with HTML.ActionLink?Following is my code:1) When I write the below code it works perfect. @Html.ActionLink("ICD9s", "Index", "EHR")2) When I write the below code it doesn't navigate to the specified url. @Html.ActionLink("ICD9s", "Index", "EHR", new { @class = "linkbtnfull"})Thanks 解决方案 Try [email protected]("Link Name", "ActionName", "ControllerName", null, new { @class = "linkbtnfull" } )you code should be, @Html.ActionLink("ICD9s", "Index", "EHR", null,new { @class="linkbtnfull"})Specify which type of error occurs or what happens when you click the link.I have below format for writing action link which is working :@Html.ActionLink("ICD9s", "Index", "EHR", null,new { @class="round"})@Html.ActionLink("ICD9s", "Index", new { Controller = "EHR" },new { @class="round"})Hi,Try to use _class="linkbtnfull" instead of @class = "linkbtnfull"you code should be,@Html.ActionLink("ICD9s", "Index", "EHR", new { _class = "linkbtnfull"})hope this works for you........ 这篇关于将CSS添加到HTML.ActionLink后,它不会导航到URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-21 03:22