How to make the Controller get the "LinkText" Text from @Html.ActionLink

1

In my application there was a need to make the same Controller called Classification have the Reclassification function, so I want the ControllerClassificar to get the string LinkText @Html.ActionLink to be able to control the visibility of some components HTML of my View , being they columns of the existing table in View Index and also control the visibility of some fields in Views Insert , Details e Delete

Getting the links:

@Html.ActionLink("**Classificação**", "Index", "Classificacao")

@Html.ActionLink("**Reclassificação**", "Index", "Classificacao")

I want my Controller to take the value Rating and Reclassification and send ViewBag to Views and thus control visibilities involved. p>     

asked by anonymous 14.08.2018 / 23:15

1 answer

2

You can make ActionResult accept a string parameter like this:

public ActionResult Classificacao(string name = null){

}

and ActionLink would look like:

@Html.ActionLink("**Classificação**", "Index", "Classificacao", new{name = "**Classificação**"})
    
15.08.2018 / 03:34