Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串变量,其中包含我想要的图像所在位置的 url,如何将此值传递给图像?我试着做 <%my variable here%> 但它没有用。
<asp:Image ImageUrl="" runat="server"/>
<asp:Image Id="image1" ImageUrl="<%= yourVariable %>" runat="server"/>
另一种方法是在文件后面的代码中设置它:
image1.ImageUrl = "http://example/logo.png"