asp:Image inside editable DetailsView

  • Thread starter Christian Schlemmer
  • Start date
C

Christian Schlemmer

hi,

in a DetailsView i have a image display.

images i want to store in a seperate directory, but it a path is added to
Bind update and delete is not working.


just Bind makes my DetailsView updateable, but scripts and images would be
nice to be seperated.

<asp:TemplateField HeaderText="Bild">
<ItemTemplate>
<asp:Image ID="Bild" ImageUrl='<%# Bind("Bild") %>'
runat="server" />
</ItemTemplate>
<EditItemTemplate>
<asp:Image ID="Bild" ImageUrl='<%# Bind("Bild") %>'
runat="server" />
</EditItemTemplate>
</asp:TemplateField>

Bind with path parameters displays the image correctly, but makes my
DetailsView uneditable

<asp:TemplateField HeaderText="Bild">
<ItemTemplate>
<asp:Image ID="Bild" runat="server" ImageUrl='<%#
Bind("Bild", "../Upload/{0}") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:Image ID="Bild" runat="server" ImageUrl='<%#
Bind("Bild", "../Upload/{0}") %>' />
</EditItemTemplate>
</asp:TemplateField>

Container.DataItem displays the image correctly, but makes my DetailsView
also uneditable

<ItemTemplate>
<asp:Image ID="Bild" ImageUrl='<%# "../Upload/" &
Container.DataItem("Bild") %>' runat="server" />
</ItemTemplate>
<EditItemTemplate>
<asp:Image ID="Bild" ImageUrl='<%# "../Upload/" &
Container.DataItem("Bild") %>' runat="server" />
</EditItemTemplate>


would be apprechiated for a suggestion.

thanks a lot

Christian
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top