开发者

Good approach for conditionally setting CSS class mvc

I know I can use HtmlHelpers which will access data repository and return the appropriate cl开发者_运维百科ass.

<a class="<%= Html.GetOnOffState(); %>"...

But what other approaches are there?


Write an entire actionlink helper so that instead of the following tag soup:

<a class="<%= Html.GetOnOffState(); %>"..

you would use:

<%= Html.ToggableActionLink("foo", "bar") %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜