I use the following ajax ActionLink method.
@Ajax.ActionLink(" ", "RemovePerson", "General", new { PersonId = item.PersonId }, new AjaxOptions { Confirm = "Are you sure?", HttpMethod = "Delete", OnSuccess = "JsonDelete_OnSuccess" }, new { @class = "PersonRemove" })
$().ready(function () {
$(".PersonRemove").button({ icons: { primary: "ui-icon-trash"} });
})
The result is showed bellow:

As you can see, the linkText parameter is ” “. I don’t want any text in my button. Only one icon. I didn’t found any other solution for having an ajax ActionLink without text but I’m not very satisfied with it. I need some advise about it.
Is there a better solution than having this ActionLink with the first parameter as ” ” ?
I would prefer something like:
@Ajax.ActionLink(null, ....
But it doesn’t work. I got the error “Value cannot be null or empty”
Thanks.
Indeed, that’s annoying. You could write a custom MyActionLink helper:
and then: