possible config probem??

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

Holly Li

Hi,
I have an aspx page that has an image button on it.
The image url of this button is another aspx page that
output an image.

<asp:imagebutton id="ibtnMap" runat="server"
ImageUrl="ImageOutput.aspx"></asp:imagebutton></TD>

The page works fine on all our dev boxes but doesn't work
on the staging and production boxes that are out of our
developer's control. The button has a broken image icon
on it.

To rule out problem one by one, does someone know that if
there is a config issue that could prevent the second
aspx page ("ImageOutput.aspx")to be called?

Thanks
Holly Li
 
It works fine on some machines (machines that we
configed. The machines that are not working are those out
of our control.)
I have put some codes in ImageOutPut.aspx to display
things like error message. It acts like this page is
never been called. Thanks
 
I checked that the Imageoutput.aspx is called. Here is
the code. Could you check if the code is correct. Thanks

private void Page_Load(object sender, System.EventArgs e)
{
//I can't create image in this class
becasue of other issues. So I create the image in other
page and put it in session
MapImage myMapImage = (MapImage)
Session["MAPIMAGE"];

if (myMapImage == null)
{
Bitmap strimg= new Bitmap
(400,200);

Graphics graph =
Graphics.FromImage(strimg);
Font myFont=new Font
("Verdana", 15);
StringFormat format=new
StringFormat();
format.FormatFlags =
StringFormatFlags.DirectionVertical;

graph.DrawString("Error
getting image",myFont, new SolidBrush(Color.Red), 5, 100);

strimg.Save
(Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Jpeg);
graph.Dispose();
strimg.Dispose();


}
else
{
//This line prevents the
map from being cached locally.

Response.Cache.SetCacheability
(HttpCacheability.NoCache);

//Now clear the buffer
and write the bits to the page.
Response.Clear();
Response.ContentType =
myMapImage.MimeData.MimeType;
Response.BinaryWrite
(myMapImage.MimeData.Bits);
}
Response.End();
}

Holly Li
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top