By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

How do I copy Images in Datalist without going to Server Asp.Net

P: n/a
I have a page with two Datalists containing X number of ImageButtons.
When the user clicks on an image in Datalist1 I need to copy the image
to "Obverseimg" when the user clicks an image in Datalist2 I need to
copy this image to "Reverseimg". This all works fine when it uses
"Runat Server".

How can I do this without going back to the server? It gets much to
slow refreshing all the images for every click. What Javascript can I
use? Note that the images are comming from a SQL table. Not from any
..jpg or .gif.

Any help will be greatly appreciated.
<table width="100%">
<tr>
<td id = "result" align="center">
<asp:Image ID="Obverseimg" Width="110" Height="110"
visible="true" runat="server" />
<asp:Image ID="Reverseimg" Width="110" Height="110"
visible="true" runat="server" /&nbsp
<asp:button id="Searchbtn" runat="server" Width="100px"
ForeColor="White" Font-Bold="True" Text="Search"
BackColor="Red" BorderStyle="Ridge" BorderWidth="5px"
BorderColor="Red" Visible="False"></asp:button>&nbsp
<asp:Label ID="coin1" runat="server" Text="0"
Visible="False"></asp:Label>
<asp:Label ID="coin2" runat="server" Text="0"
Visible="False"></asp:Label></td>
</tr>
</table>
<table style="width: 100%; background-color: #000050"
border="0" cellspacing="10" cellpadding="0">
<tr>
<td style="width: 50%" valign="top">
<asp:DataList ID="DataList1" runat="server" RepeatColumns="4"
RepeatDirection="Horizontal" ShowFooter="False"
ShowHeader="False" BorderStyle="Groove" Width="300px">
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" Width="110"
Height="110" runat="server"

ImageUrl='<%#FormatURL(DataBinder.Eval(Container.D ataItem,"ID"),"Image")
%>'

CommandArgument='<%#FormatSame(DataBinder.Eval(Con tainer.DataItem,"ID"))%>'

OnClick="ImageButton1_Click" BorderColor="Gold"
BorderStyle="Ridge" BorderWidth="3px"/>
</ItemTemplate>
<EditItemStyle BorderStyle="Groove" />
<SelectedItemStyle BorderColor="Red" />
</asp:DataList>
</td>
<td style="width: 50%" valign="top">
<asp:DataList ID="DataList2" runat="server"
RepeatColumns="4"
RepeatDirection="Horizontal" ShowFooter="False"
ShowHeader="False" BorderStyle="Groove" Width="300px">
<ItemTemplate>
<asp:ImageButton ID="ImageButton2" Width="110"
Height="110" runat="server"

ImageUrl='<%#FormatURL(DataBinder.Eval(Container.D ataItem,"ID"),"Image")
%>'

CommandArgument='<%#FormatSame(DataBinder.Eval(Con tainer.DataItem,"ID"))%>'

OnClick="ImageButton2_Click" BorderColor="Gold"
BorderStyle="Ridge" BorderWidth="3px"/>
</ItemTemplate>
<EditItemStyle BorderStyle="Groove" />
</asp:DataList>
</td>
</tr>
</table>
</td>
<td id="rightcontent" width="10%">
</td>
</tr>
</table>

Aug 29 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
BengtPelle said the following on 8/29/2006 10:37 AM:
I have a page with two Datalists containing X number of ImageButtons.
When the user clicks on an image in Datalist1 I need to copy the image
to "Obverseimg" when the user clicks an image in Datalist2 I need to
copy this image to "Reverseimg". This all works fine when it uses
"Runat Server".

How can I do this without going back to the server? It gets much to
slow refreshing all the images for every click. What Javascript can I
use? Note that the images are comming from a SQL table. Not from any
..jpg or .gif.
The browser doesn't know, nor does it care, where the images came from.
Any help will be greatly appreciated.
Post a URL to a sample page or the HTML that is generated. The server
side code does no good for trying to solve client side issues.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 29 '06 #2

P: n/a
I know that the browser does not care, however, I was asking for help
in copying a selected Image to another Image, regardles of where it
came from.
Randy Webb wrote:
BengtPelle said the following on 8/29/2006 10:37 AM:
I have a page with two Datalists containing X number of ImageButtons.
When the user clicks on an image in Datalist1 I need to copy the image
to "Obverseimg" when the user clicks an image in Datalist2 I need to
copy this image to "Reverseimg". This all works fine when it uses
"Runat Server".

How can I do this without going back to the server? It gets much to
slow refreshing all the images for every click. What Javascript can I
use? Note that the images are comming from a SQL table. Not from any
..jpg or .gif.

The browser doesn't know, nor does it care, where the images came from.
Any help will be greatly appreciated.

Post a URL to a sample page or the HTML that is generated. The server
side code does no good for trying to solve client side issues.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.