This is a migrated thread and some comments may be shown as answers.

Replace image in Ajax ActionLink

1 Answer 107 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
saroj
Top achievements
Rank 1
saroj asked on 18 Mar 2012, 07:48 AM
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.

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 22 Mar 2012, 08:26 AM
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.
Tags
Ajax
Asked by
saroj
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or