by Bar Zohan
21. January 2010 00:25
Mvc framework has an html helper for giving ajax links (Ajax.ActionLink), but it does not provide one like Ajax.ImageActionLink. But ofcourse there is a simple, tricky workaround
.
<%= Ajax.ActionLink("[imglnk]", "IndexContent", new { id = "main" }, new AjaxOptions { UpdateTargetId = "RightContent", OnBegin = "beginAjax", OnSuccess = "successAjax", OnFailure = "failureAjax" }, new { control = "content", index = "anasayfa" }).Replace("[imglnk]", "<img src=\"/i/logo.gif\" ... />")%>
The thing that is done here is realy simple; I normally create an Ajax Link using Ajax.ActionLink that writes '[imglnk]' on the page. After that I replace the '[imglnk]' text with standart html code that puts an image on the page.
