[英]Images on aspx pages with Master Page
I have one master page, in short there are two images on the master page (a logo at the top, and a fb link at the bottom). 我有一个母版页,简而言之,母版页上有两个图像(顶部是一个徽标,底部是一个fb链接)。
I do however have an admin folder for the .aspx pages for when admin log in. 但是,当管理员登录时,我确实有.aspx页面的管理员文件夹。
All non-admin pages need to access these two images with the src of image/logo.jpg and image/fb.jpg. 所有非管理页面都需要使用image / logo.jpg和image / fb.jpg的src访问这两个图像。 However the admin pages need to access the image with the src of /image/logo.jpg and /image/fb.jpg.
但是管理页面需要使用/image/logo.jpg和/image/fb.jpg的src访问图像。
Is it possible to achieve two separate paths depending on the folder, without having to create a second master page? 是否可以根据文件夹实现两个单独的路径,而无需创建第二个母版页?
<img src="/images/yourimage.png" />
使用Image Server控件而不是html img标签或ResolveUrl方法来处理生成的url:
<img src='<%= ResolveUrl("~/images/yourimage.png") %>' />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.