image not rendered when expected
- From: "Bruce" <coding-r-us@xxxxxxxxxxxxxxxx>
- Date: Wed, 3 May 2006 10:37:13 -0700
Although I have quite a bit of WinForms experience, I am new to ASP.NET. So
don't be surprised by the elementary question. :)
I am creating a webpage with a dropdown list that allows the user to select
an image from the list. Based on that feedback, the page calls a web service
to grab the requested image (based on an index from the dropdown) and place
it on the local file system. Then it is supposed to update the Image
control on the page by assigning a new path (via the ImageURL method on the
control). But the new image is never rendered. See code snip below.
I verified that the file accessed from the web service was actually placed
in its target location.
Is there some equivalent operation to the "invalidation " of a control that
is done in WinForms to force a redraw? Else, what else might I be missing?
Thanks, Bruce
-----------------------------------------------------------------
protected void ButtonShowImage_Click(object sender, EventArgs e)
{
long index;
byte[] bytes;
index = Convert.ToInt64( DropDownList.SelectedItem.ToString());
asset = m_ServerOld.GetAssetElements(index);
bytes = asset.fileImage;
string fullPath = @"c:\temp\" + asset.originatorName;
string fileSpec = fullPath + @"\" + asset.fileName;
DirectoryInfo target = new DirectoryInfo(fullPath);
if (!target.Exists) target.Create();
using (FileStream fs = new FileStream(fileSpec, FileMode.Create,
FileAccess.Write))
{
fs.Write(bytes, 0, bytes.Length);
}
// ImageBox.ResolveUrl(fileSpec);
ImageBox.ImageUrl = fileSpec;
}
.
- Follow-Ups:
- RE: image not rendered when expected
- From: Steven Cheng[MSFT]
- Re: image not rendered when expected
- From: Göran Andersson
- Re: image not rendered when expected
- From: MSDN
- Re: image not rendered when expected
- From: Patrice
- RE: image not rendered when expected
- Prev by Date: The current configuration system does not support user-scoped settings.
- Next by Date: Re: The current configuration system does not support user-scoped settings.
- Previous by thread: The current configuration system does not support user-scoped settings.
- Next by thread: Re: image not rendered when expected
- Index(es):
Loading