开发者

tree view properties in web application

开发者 https://www.devze.com 2023-01-12 00:16 出处:网络
i open a web application in visual studio 2008... it contain the tree view properties as, TreeNodeType type;

tree view properties in web application

i open a web application in visual studio 2008... it contain the tree view properties as,

            TreeNodeType type;
            type = new TreeNodeType();
    开发者_如何学Python        type.Type = "folder";
            type.ImageUrl = "Images/" + "folder.gif";
            type.ExpandedImageUrl = "Images/" + "folderopen.gif";

i dont know how this image tag comes.. and how to chage that...


If your image directory is in the root of the application you should use the tilde character '~' at the start:

 type.ImageUrl = "~/Images/" + "folder.gif";

you should include the full path to the image from the root, so if the image is in Content/Images:

 type.ImageUrl = "~/Content/Images/" + "folder.gif";

At runtime, the '~/' is translated to the correct path to the image and rendered to the page.

If this is not working, you need to post the relevant markup of the page and the codebehind. Alos, it would help if you rightclick the image in IE and slect properties. You can see the expected path there. Or open the page in Firefox, with the Firebug Addon installed, right click the image and select Inspect Element. This will show you the path that was rendered and you can compare this to where the image actually is in your project.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号