开发者

How can I use an image or icon resource from global resource file in an asp:Image control to set the ImageUrl attribute?

How can I use an image or icon resource from global resource file in an asp:Image control to s开发者_如何学JAVAet the ImageUrl attribute?


In code:

ClientScriptManager cs = Page.ClientScript;
myImage.ImageUrl= cs.GetWebResourceUrl(type, "resource name");

In the markup:

<asp:Image 
     ImageUrl="<%= Page.ClientScript.GetWebResourceUrl(typeof(MyClass), 
     "resource name") %>" 
 />

See the documentation for ClientScriptManager.GetWebResourceUrl for more info.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜