using .aspx page to output image problem

  • Thread starter Thread starter Holly
  • Start date Start date
H

Holly

Hi,
I have a page (A) that allows users to enter addresses
and displays direction information and map images.
The page A calls Microsoft's mappoint web service, gets
the route info and map image. Page A contains an image
button with the image url set as MapOutput.aspx
<asp:imagebutton id="ibtnMap" runat="server"
ImageUrl="MapOutput.aspx"></asp:imagebutton>

After page A got the image, it stores the image into
session. In MapOutput page, it gets the image out from
session and output the image through Response object.

The map works fine on a single web server setup. The
image wouldn't show up on a load balanced web server
setup (consists of two web servers). Sticky session is
working since it is also used in other places.

Does anyone have ideas?

Thanks.

Holly Li
 
Holly,
I admitedly don't know the full picture (no pun intended), but it seems to
me you could rearchitect things to make a lot more sense and probably avoid
this problem. The thing that sticks out the most is: Why is page A calling
the webservice as opposed to MapOutput.aspx ???

It also seems to me that you are using a session simply to communicate
between page (A) and MapOutput.aspx - which is a poor way to communicate
between a page and a user control.

I would create an address class (hopefully you already have one)

public class Address
pirvate street as string
private zip as string
...
public property ....
end class

I would create a custom server control which inherits from ImageButton and
exposes a property of type Address

public class MapPointImage
inherits ImageButton

private _address as Address
public property Address() as Address
get
return _address
end get
set (value as Address)
_address = value
end set
end property


and would implement the Webservice code in the render method of this class.

You can then create the address object in page A and set it to the Address
property of yourMapPointImage reference.

Karl
 
Back
Top