Adam
Adam

Reputation: 6192

ASP.NET chart control background image: URL is not a valid virtual path

I'm trying to set a background image on my ASP.NET (built-in) chart control to an image located on: http://www.example.com/images/logo.png I can access this image in my browser.

But I'm getting this error:

'http:/www.example.com/images/logo.png' is not a valid virtual path.

Notice how 1 / character is removed from the path after the protocol name.

My code:

<asp:Chart ID="chartPriceHistory" runat="server">
</asp:Chart>

I tried this:

chartPriceHistory.BackImage = "http:\/\/www.example.com/images/logo.png"

chartPriceHistory.BackImage = "http://www.example.com/images/logo.png"

Both scenarios throw the same error.

What else could I do?

Upvotes: 0

Views: 359

Answers (1)

wazz
wazz

Reputation: 5078

That's not a virtual path. Can you store the image locally and do ~/img/...?

Upvotes: 1

Related Questions