我在中繼器內部有一個圖像控件。我想排除/忽略imageurl屬性中的參數,因爲路徑(源圖像)在名稱中沒有此參數,但我仍然想在url中顯示參數。我不能重新命名所有的圖像,因爲有很多。希望它是有道理的。排除/忽略圖像ImageUrl中的參數,但仍顯示在Repeater內
這裏是一個例子。
這是SEO。原路徑
- /product/0001_100_00_KK00_F02.png
我理想中IMAGEURL顯示
- /product/0001_100_00_KK00_F02.png/Tv-Sony-lcd-black-bravia- KDL-26V4500
OR
- /product/0001_100_00_KK00_F02/Tv-Sony-lcd-black-bravia-KDL-26V4500.png
<asp:Repeater ID="rptImages" runat="server"> <ItemTemplate> <asp:Image ID="Image1" ImageUrl='<%# Eval("Url") %>' runat="server" /> </ItemTemplate> </asp:Repeater>
而且代碼隱藏
rptImages.DataSource = Images.Select(s => new { Url = s }); rptImages.DataBind();
這適用於原始路徑。但是當我添加/Tv-Sony-lcd-black-bravia-KDL-26V45000
到URL的結尾時,圖像沒有找到(當然)。
那麼如何添加一個額外的參數到imageurl,但讓圖像控制忽略這一點,仍然找到圖像路徑?
任何人都不會有如何解決這個問題
圖像控件沒有_find_圖像,它只是輸出你請求的URL。是否可以找到圖像是您的網絡服務器如何響應客戶端瀏覽器提出的圖像URL請求的問題。 – 2012-01-02 13:04:41