问题
Scenario: Within ASP.NET site, I have an ASPX page where within OnLoad event, I set the imageUrl for one of the image controls. This URL value comes from an external source and the image is not getting displayed and I found out it is because the URL is too long.
How to display images of longer URLs? Should I use POST with javascript or any other options to achieve? The values within the URL are crucial and I can't loose some of the parameters.
Please suggest.
Code in OnLoad event is something below.
Image pImage = new Image();
pImage.ImageUrl = imageFile; // imageFile is the one having long URL.
Update 1: If I am able to achieve the POST in OnLoad, then I think image will get displayed. Please suggest how to acheve this in OnLoad.
Update 2 : The actual URL is below.
http://example.com/is/m//company1/Rec-Sc-105-QL2?setAttr.safe={visible=false}&setAttr.insertedTextPlaceholder={visible=false}&setElement.height_weight=%253Ccontent%253E%253Cdiv%2520columnCount%253D%25221%2522%2520columnGap%253D%252218%2522%2520fontFamily%253D%2522Comic%2520Sans%2520MS%2522%2520textAlign%253D%2522left%2522%2520s7%253AcolorName%253D%2522100%2525%2520Black%2522%2520s7%253Acolorspace%253D%2522defined%2522%2520s7%253AcolorValue%253D%2522%2523FF%2522%253E%253Cp%253E%253Cspan%253EHeight%2520%2526amp%253B%2520Weight%253C/span%253E%253C/p%253E%253C/div%253E%253C/content%253E&setAttr.height_weight=%7Bheight=17.825466666666667%2526visible=true%2526rotation=0%7D&setAttr.photo={y=91.5186%26x=210.501%26width=40.883668%26height=61.4792%26visible=false%26rotation=0%26scaleX=1.0%26scaleY=1.0%26source%3D@Embed%28%27is%28company1/19168388%29%27%29}&setAttr.bleed={visible=false}&setAttr.insertedImagesPlaceholder={visible=false}&setElement.name=%253Ccontent%253E%253Cdiv%2520columnCount%253D%25221%2522%2520columnGap%253D%252218%2522%2520fontFamily%253D%2522Comic%2520Sans%2520MS%2522%2520textAlign%253D%2522left%2522%2520s7%253AcolorName%253D%2522100%2525%2520Black%2522%2520s7%253Acolorspace%253D%2522defined%2522%2520s7%253AcolorValue%253D%2522%2523FF%2522%253E%253Cp%253E%253Cspan%253EName%253C/span%253E%253C/p%253E%253C/div%253E%253C/content%253E&setAttr.name=%7Bheight=17.825466666666667%2526visible=true%2526rotation=0%7D&setElement.date=%253Ccontent%253E%253Cdiv%2520columnCount%253D%25221%2522%2520columnGap%253D%252218%2522%2520fontFamily%253D%2522Comic%2520Sans%2520MS%2522%2520textAlign%253D%2522left%2522%2520s7%253AcolorName%253D%2522100%2525%2520Black%2522%2520s7%253Acolorspace%253D%2522defined%2522%2520s7%253AcolorValue%253D%2522%2523FF%2522%253E%253Cp%253E%253Cspan%253EDate%253C/span%253E%253C/p%253E%253C/div%253E%253C/content%253E&setAttr.date=%7Bheight=17.82646666666667%2526visible=true%2526rotation=0%7D&setElement.announcement=%253Ccontent%253E%253Cdiv%2520columnCount%253D%25221%2522%2520
Update 3: I now get HTTP 403 forbidden error when I try to browse the URL in a separate window. Any suggestions?
回答1:
We resolved the issue by using webservices and getting the url details.
来源:https://stackoverflow.com/questions/10709044/need-to-display-image-in-aspx-page-that-has-long-url