Me gustaría convertir un enlace a un enlace de acción ajax. No puedo entender cómo mostrar elementos html dentro del texto del enlace?crear ajax actionlink con elementos html en el texto del enlace
Aquí es el enlace original:
<a href="#onpageanchor" id="myId" class="myClass" title="My Title."><i class="icon"></i>Click Me</a>
Aquí es el ajax ActionLink:
@Ajax.ActionLink("<i class='icon'></i>Click Me", "MyActionMethod", new { id = "testId" },
new AjaxOptions
{
UpdateTargetId = "mytargetid"
}, new
{
id = "myId",
@class = "myClass",
title="My Title."
})
el texto del enlace prestado es la cadena real: "<i class='icon'></i>Click Me</a>"
http://stackoverflow.com/questions/9194876/asp-net-mvc-ajax-actionlink-with-a-htmlstring –
¿Ha pensado simplemente usando jQuery para enviar la solicitud? – Paul
Por favor, vea mi respuesta a esto en http://stackoverflow.com/questions/341649/asp-net-mvc-ajax-actionlink-with-image/17151675#17151675 – JotaBe