Re: DataImageUrlField in DetailsView

Tech-Archive recommends: Speed Up your PC by fixing your registry



Jesse,
Thanks for the answer. I have done images this way before but the docs say
it can be done the way we were trying - thought there might be some
automatically generated streaming in the control somehow.

BTW, along with an MSDN subscription comes a "gaurantee" of a response
within either 24 or 48 hours in these newsgroups from a Microsoft support
person. I have used this for years. Look at responses to my postings and
you will see that along with community answers, I get microsoft responses to
all of my postings

--
Regards,
Gary Blakely
Dean Blakely & Associates
www.deanblakely.com

"Jesse Houwing" <Jesse.houwing@xxxxxxxxxxxxxxxx> wrote in message
news:21effc90dc0b8c9ab0a19356abd@xxxxxxxxxxxxxxxxxxxxx
Hello GaryDean,

(This issue has already been posted by one of our developers (Tina)
but I am
reposting
it because it's urgent and I have the MSDN subscription so we are
guessing I
may
be more likely to get a response)
I can't get an image to show in a DetailsView. I am trying both an
ImageField and a template field with an image in it with databindings
to the datasource. I know the datasource works because the image
shows in the test. All I get is the RED X.

I have google searched this problem and I have seen it reported
several times but never answered. Is this a bug? Is there a
workaround?

here is my DetailsView definition......................
<asp:DetailsView ID="dvDetails" runat="server"
Height="50px"
Width="708px" AutoGenerateRows="False" DataSourceID="dsDetails">
<Fields>
<asp:CheckBoxField DataField="active"
HeaderText="active" SortExpression="active" />
<asp:BoundField DataField="numresumesposted"
HeaderText="numresumesposted" SortExpression="numresumesposted" />
<asp:BoundField DataField="address1"
HeaderText="address1" SortExpression="address1" />
<asp:BoundField DataField="hoursavailable"
HeaderText="hoursavailable" SortExpression="hoursavailable" />
<asp:BoundField DataField="maxhoursperweek"
HeaderText="maxhoursperweek" SortExpression="maxhoursperweek" />
<asp:BoundField DataField="resumetitle"
HeaderText="resumetitle" SortExpression="resumetitle" />
<asp:BoundField DataField="resumefilestring"
HeaderText="resumefilestring" SortExpression="resumefilestring" />
<asp:ImageField AccessibleHeaderText="Photo"
DataImageUrlField="photo">
</asp:ImageField>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="Image1" runat="server"
Height="166px" ImageUrl='<%# Eval("photo") %>'
Width="175px" />
</ItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
thanks,
Gary

If the field photo contains the binary data to make up that image, you
won't get it to work this way. Just think about it. Have you ever seen an
HTML page where the binary contents of the image are embedded into the
page itself? It's always a URL to the actual image.

So you will have to write a page (or better yet an httphandler) to stream
the binary contents from the database. And in the grid you need to supply
the image url with the url to that page/handler.
There are a number or websites that explain this in detail.

http://www.codeproject.com/aspnet/ImageBinaryStream.asp
http://www.primaryobjects.com/CMS/Article59.aspx
http://www.codeguru.com/columns/vb/article.php/c14061/

Jesse
PS: My answering this question has nothign to do with the fact that you
might have a MSDN subscription. The poeple answerign questions cannot see
that in any way. Everybody is equal (just the MVP's a little more equal
than the rest ;)).




.



Relevant Pages

  • Re: DataImageUrlField in DetailsView
    ... I can't get an image to show in a DetailsView. ... I know the datasource works because the image ... My answering this question has nothign to do with the fact that you might have a MSDN subscription. ... The poeple answerign questions cannot see that in any way. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DataImageUrlField in DetailsView
    ... it because it's urgent and I have the MSDN subscription so we are ... I can't get an image to show in a DetailsView. ... I know the datasource works because the image ... The poeple answerign questions cannot see ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Test message
    ... response within 1 business day and each later response within 2 ... your renewing MSDN subscription has been successful. ... will be captured and you will get support from Microsoft. ... MSDN Managed Newsgroup Support Service Introduction ...
    (microsoft.public.access.forms)
  • Re: Has Windows XP Service Pack 2 broken the Video Mixing Renderer
    ... You get free incidents ... with an MSDN subscription. ... you might get a response from the VMR's author. ... (Otherwise, don't expect a followup) ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Playing Video Backwards & OnTime()
    ... Do you have an MSDN subscription with managed newsgroup support? ... don't anticipate any MS response. ...
    (microsoft.public.win32.programmer.directx.video)