Replace image in Ajax ActionLink

2 posts, 0 answers
  1. saroj
    saroj avatar
    39 posts
    Member since:
    Oct 2011

    Posted 18 Mar 2012 Link to this post

    Hi,

    I am trying to replace Ajax ActionLink with image instead of text but not getting done, my code is as below, can any one help?

    @Ajax.ActionLink("Add ", "LogsGetData", "Logs", new { Id = 0 },
                            new AjaxOptions
                            {
                                UpdateTargetId = "LogEntryDiv",
                                InsertionMode = InsertionMode.Replace,
                                HttpMethod = "GET",
                                OnSuccess = "SettingsOnSuccess"
                            }).ToHtmlString().Replace("Add", "<img src=\"Content/Telerik/Office2007/sprite.png\" ... />")


    Above code replace the text "Add" with   <a data-ajax="true" data-ajax-method="GET" data-ajax-mode="replace" data-ajax-success="SettingsOnSuccess" data-ajax-update="#LogEntryDiv"   but doesn't get the image.
  2. Andrey
    Admin
    Andrey avatar
    836 posts

    Posted 22 Mar 2012 Link to this post

    Hi,

    You could check this StackOverflow discussion for information on how to use <img> tags and sprites withing the <img> tag.

    All the best,
    Andrey
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top