Hello ,
Is there a possibility to convert MVC html Helper to html Link. So what I want exactly to do:
I have this html helper:
@Html.LinkTo(MVCController, MVCAction, new { area = MVCArea, id = row.Id, menuId = ViewBag.CurrentMenu }, row.Id, columnValue, col.Data.Name, DynamicTypeName).
I want to convert to something like this: 'a href= "ControllerName/controlleraction/`+ parameter1 .... > /a>'. Where controller name is MVCController, controller action is MVCAction and the others variable are parameters that are sent to controller.
I have a result of the search, displayed in the table, in which each row has a link to the controller sent as a parameter. Now I want to replace the existing table with a Jquery datatable and send ajax request to the server which returns a Json object. That Json object should contain the link that is created with:
@Html.LinkTo(MVCController, MVCAction, new { area = MVCArea, id = row.Id, menuId = ViewBag.CurrentMenu }, row.Id, columnValue, col.Data.Name, DynamicTypeName).
"
My question is: Is it possible to create in controller action (which return json object) a string that will be equal to the string created with the @Html.LinkTo helper?
Thanks in advance,
Regards Stole