c# - Viewbag properties inside action link helper -
i trying include , viewbag object inside actionlink helper.
@html.actionlink( "date" + viewbag.icon , "index", new{ sortby=viewbag.datesort})
logic viewbag.
viewbag.icon = (viewbag.datesort == "date desc") ? "▼" :"▲";
i implement sort here.
just add datesort viewbag in controller, , in view:
@{ var dateheader = "date " + (viewbag.datesort == "date desc" ? "▼" : "▲"); } @html.actionlink(dateheader, "index", new { sortby = viewbag.datesort })
Comments
Post a Comment