如何在mvc4中启用/禁用ActionLink html帮助程序? [英] How do I enable/disable the ActionLink html helper in mvc4?
问题描述
在我的项目中,有五个导航链接,使用@ html.ActionLinks作为部分视图表示。每个链接代表一个不同的页面。当用户在第一页时,所有链接都应该被禁用
当用户点击按钮被定向到第二页时,只有第一个链接变为活动而其他全部链接链接保持不活动状态。
在每个视图中,我通过@ html.RenderPartial(_ partialViewName)调用此部分视图
那么如何在控制器中动态更改ActionLinks的行为?
In my project, there are five navigation links, represented using @html.ActionLinks as Partial view.Every link represents a different page. When the user is at first page all the links should be disabled
when the user is directed to second page on clicking a button, only first link becomes active and other all links remain inactive.
In every view I am calling this partial view by @html.RenderPartial("_partialViewName")
So how can I change the behavior of ActionLinks dynamically in a controller?
推荐答案
achor标签具有启用和禁用属性。您可以使用它
achor tag has property of enable and disable.you can use it
为此提供帮助 [ ^ ]
请检查以上小提琴,这对你有帮助
谢谢
:)
fiddle for this[^]
Please check the above fiddle, may this help you
Thanks
:)
这篇关于如何在mvc4中启用/禁用ActionLink html帮助程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!