asp:SiteMapPath 与动态图像
好的,所以我正在构建面包屑,并且根据面包屑的值,图像将成为分隔符。 因此“HOME”将有一个图像,“SEARCH”将有另一个图像。
我知道我可以通过编程来做到这一点(至少我假设),但是有没有更简单的方法来做到这一点? 我可以根据节点的值将图像链接到节点吗? 我可以使用 PathSeparatorTemplate 来完成吗?
谢谢。
Ok, so I'm building bread crumbs and depending on the value of the breadcrumb an image will be the seperator. So "HOME" will have one image and "SEARCH" will have another.
I know I can do this programatically (at least I ASSUME) but is there an easier way to do this? Can I link an image to a node based on the value of the node? Can I do it with PathSeparatorTemplate?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将其放入
PathSerparatorTemplate 中,但仍然需要从代码中设置图像 url。
You can put an
into the PathSerparatorTemplate but you still have to set the image url from code.
我看到您已经接受了答案,但我认为一些代码会有所帮助,所以这里有一些:
Site1.Master
Site1.Master.cs
然后我有一个
/images
目录,其中包含每个的图像SiteMapNode
的Key
。 换句话说:此代码将导致在每个路径节点之后显示的图像取决于其之前节点的键。希望这对某人有帮助。
I see you have already accepted an answer, but I thought some code would help, so here is some:
Site1.Master
Site1.Master.cs
Then I have an
/images
directory containing an image for each of theKey
's of theSiteMapNode
s. In other terms: this code will result in the image being displayed, after each of the path nodes, to depend on the key of the node before it.Hope this helps someone.