需要在具有长URL的ASPX页面中显示图像

时间:2012-05-22 19:45:24

标签: javascript asp.net post url-rewriting imageurl

场景:在ASP.NET站点中,我有一个ASPX页面,在OnLoad事件中,我为其中一个图像控件设置了imageUrl。此URL值来自外部源,图像未显示,我发现这是因为URL太长。

如何显示较长网址的图片?我应该使用POST与JavaScript或任何其他选项来实现? URL中的值是至关重要的,我不能松开一些参数。

请建议。

OnLoad事件中的代码如下所示。

        Image pImage = new Image();

        pImage.ImageUrl = imageFile; // imageFile is the one having long URL.

更新1:如果我能够在OnLoad中实现POST,那么我认为图像将会显示。请在OnLoad中建议如何实现这一点。

更新2:实际网址如下。

http://example.com/is/m//company1/Rec-Sc-105-QL2?setAttr.safe= {可见=假}&安培; setAttr.insertedTextPlaceholder = {可见=假}&安培; 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%2526安培%253B%2520Weight%253C /跨度%253E%253C / p%253E%253C /格%253E%253C /内容%253E&安培; setAttr.height_weight =%7Bheight = 17.825466666666667%2526visible =真%2526rotation = 0%7D&安培; setAttr.photo = {Y = 91.5186%26X = 210.501%26width = 40.883668%26height = 61.4792%26visible =假%26rotation = 0%26scaleX =1.0%26scaleY=1.0%26source%3D@Embed%28%27is%28company1/19168388%29%27%29}&安培; setAttr.bleed = {可见=假}&安培; setAttr.insertedImagesPlaceholder = {可见=假}&安培; 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 /跨度%253E%253C / p%253E%253C /格%253E%253C /内容%253E&安培; setAttr.name =%7Bheight = 17.825466666666667%2526visible =真%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 /跨度%253E%253C / p%253E%253C /格%253E%253C /内容%253E&安培; setAttr.date =%7Bheight = 17.82646666666667%2526visible =真%2526rotation = 0% 7D&安培; setElement.announcement =%253Ccontent%253E%253Cdiv%2520columnCount%253D %25221%2522%2520

更新3:当我尝试在单独的窗口中浏览URL时,我现在收到HTTP 403禁止错误。有什么建议吗?

1 个答案:

答案 0 :(得分:0)

我们通过使用网络服务并获取网址详情解决了这个问题。