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

[Solved] treeview node images won't display in Firefox

1 Answer 99 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 18 Mar 2010, 08:08 PM
I am populating the nodes of a treeview on demand via a web service. The code I have that creates the nodes is as follows:
            RadTreeNodeData c = new RadTreeNodeData();
            c.Value = child.Attribute("id").Value;
            c.Text = child.Attribute("title").Value;
            c.ImageUrl = ".\\images\\objectIcons\\" + child.Attribute("icon").Value;
Everything looks great in IE 7, Chrome, and Safari but, for some reason, the images do not show up in Firefox.

It is the same for the context menus I am creating. Here is the code for that:

                            RadMenuItem item = new RadMenuItem("Add " + child[1]);
                            item.Value = child[0];
                            item.ImageUrl = ".\\images\\objectIcons\\" + child[2];

Has anyone experienced this before?

I have tried wrapping the url in singl quotes like:

c.ImageUrl = "'.\\images\\objectIcons\\" + child.Attribute("icon").Value + "'";

But, that doesn't help firefox, and it breaks the other browsers.

I have looked for examples of setting ImageUrl on the server in a way that is acceptable for all browsers but, I haven't found any examples yet.

Thanks for whatever advice you can give



1 Answer, 1 is accepted

Sort by
0
Roger
Top achievements
Rank 1
answered on 18 Mar 2010, 08:19 PM
Disregard this thread:

Of course, after posting this, I continued to try different approaches and immediately found one that works:

            node.ImageUrl = "images/objectIcons/" + child.Attribute("icon").Value;

instead of:

            node.ImageUrl = "'.\\images\\objectIcons\\" + child.Attribute("icon").Value + "'";


Thanks.

Tags
TreeView
Asked by
Roger
Top achievements
Rank 1
Answers by
Roger
Top achievements
Rank 1
Share this question
or