开发者

two project in the same solution image url problem

I have two projects on my solution and I want to use other project pictures dynamically How can I link to other project picture (using imageurl property)

开发者_StackOverflow
System.Web.UI.WebControls.Image imd = new System.Web.UI.WebControls.Image();
imd.Width = 220;
imd.Height = 215;
imd.ImageUrl = "~/Content/Images/Attachments/test.png;
pnlattachment.Controls.Add(imd);


To access an image from another project, you'd have to embed that image as an embedded resource into the assembly and access it using GetWebResourceUrl: http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.getwebresourceurl.aspx

Or, if we are talking two web sites, you could use the ../../ notation to access the appropriate directory, since ~ only works in the context of the current virtual directory.

HTH.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜