开发者

Image disappear when url route

开发者 https://www.devze.com 2023-02-10 03:45 出处:网络
I am writing a web page to show image (image is dynamically generate by .Net charting) in a web.I have used the asp.net web forms URL routing to navigate to this page. Once I use the URL routing the i

I am writing a web page to show image (image is dynamically generate by .Net charting) in a web. I have used the asp.net web forms URL routing to navigate to this page. Once I use the URL routing the image appear on the page. Anyway this is working fine for normal page br开发者_如何学Goowse.


More than likely your link to the image is using a relative path, and once you introduce routing you are working with a URL structure that appears to be deeper nested in the folder structure than it is.

When linking to the image for display I would recommend using root relative path something like /Images/MyFile.jpg rather than ../Images/MyFile.jpg, or similar.

This way if your route changes, and additional "folders" appear in the route, the link will still work.

0

精彩评论

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