在我的.aspx代码中,我有以下元素。
<asp:Image ID="GalleryImage" runat="server" ImageUrl='<%# Eval("ProductImage") %>' />
返回的值是一个从内容交付网络获取的图像URL,示例如下:'http://cdn.xyz.com'
我想将该URL转换为'https://cdn.xyz.com'
我尝试了ImageUrl='<%# Eval("ProductImage").Replace("http","https") %>'
,但似乎没有作用。有什么建议吗?
ProductImage
是从哪里来的?你不想在.cs
(代码后台)那边进行更改吗? - teo van kot((string)Eval("ProductImage")).Replace("http","https")
? - teo van kot