New New New {id = "TestID"})
Mvc. Ajax.actionlink () can only display text content on the front page, but many times we use images as hyperlinks
public static ihtmlstring Imageactionlink ( ThisAjaxhelper Helper, String imageUrl, String AltText, String ActionName, Object routevalues, Ajaxoptions ajaxoptions, Object Htmlattributes =NULL) { varBuilder =NewTagbuilder ("img"); Builder. Mergeattribute ("SRC", IMAGEURL); Builder. Mergeattribute ("Alt", AltText); Builder. Mergeattributes (Newroutevaluedictionary (htmlattributes)); varlink = helper. ActionLink ("[Replaceme]", ActionName, Routevalues, ajaxoptions). Tohtmlstring (); returnMvchtmlstring.create (link. Replace ("[Replaceme]", builder. ToString (tagrendermode.selfclosing)); }
@Ajax. Imageactionlink (Url.content ("~/content/images/favorite.gif"), "Favorites", "Addfavorite",nullNew ajaxoptions {updatetargetid = "addfavorite"})
Ajax.actionlink (), Increased support for IMG