Click here to Skip to main content
14,736,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My code


<asp:DataList

         ID="dlDisplayAll"

         runat="server"

         DataSourceID="srcDisplayAll">

         <ItemTemplate>

             <asp:HyperLink ID="hlDisplayAll" NavigateUrl='<%#Eval("Product_ID","~/DisplayAll.aspx?Product_ID={0}") %>' runat="server">
             <asp:Image

                ID="ImgDisplay"

                runat="server"

                ImageUrl='<%#Eval("Product_ID","~/Display.aspx?Product_ID={0}") %>'

                Width="175" /></asp:HyperLink>

                <asp:HyperLink ID="hlDisplayAll1" NavigateUrl='<%#Eval("Product_ID","~/DisplayAll.aspx?Product_ID={0}") %>' runat="server">
                <asp:Image

                ID="ImgDisplay1"

                runat="server"



                ImageUrl='<%#Eval("Product_ID","~/Display1.aspx?Product_ID={0}") %>'

                width="100"/></asp:HyperLink>

            <asp:HyperLink ID="hlDisplayAll2" NavigateUrl='<%#Eval("Product_ID","~/DisplayAll.aspx?Product_ID={0}") %>'  runat="server">
            <asp:Image

                ID="ImgDisplay2"

                runat="server"

                ImageUrl='<%#Eval("Product_ID","~/Display2.aspx?Product_ID={0}") %>'

                width="100"/></asp:HyperLink>

            <asp:HyperLink ID="hlDisplayAll3" NavigateUrl='<%#Eval("Product_ID","~/DisplayAll.aspx?Product_ID={0}") %>' runat="server">
            <asp:Image

                ID="ImgDisplay3"

                runat="server"

                ImageUrl='<%#Eval("Product_ID","~/Display3.aspx?Product_ID={0}") %>'

                width="100"/></asp:HyperLink>

            <asp:Label

                ID="lblItemName"

                runat="server"

                Text='<%#Eval("Item_Name") %>'></asp:Label>

             <asp:Label

                ID="lblBrand"

                runat="server"

                Text='<%#Eval("Brand") %>'></asp:Label>

             <asp:Label

                ID="lblPrice"

                runat="server"

                Text='<%#Eval("Price") %>'></asp:Label>
          </ItemTemplate>

 </asp:DataList>



here i take four asp image take , one image is main image and other three image are related image
when mouse over on other three image its replace one

how can i do it
Posted
Comments
Prasad Khandekar 12-Mar-13 14:26pm
   
Hello,

Can you elaborate the requirement a bit more.

Regards,
Member 9815058 13-Mar-13 2:12am
   
ya sure sir

actually you visit any online shopping site say it is myntra right
now when you click on one product main image of that product and ub image display , now you mouse over on sub image than main image is replaced with sub image how can i do it
i take three sub image and one main image

1 solution

Hello,

Add a onmousehover javascript handler something like shown below.

<asp:image id="ImgDisplay" runat="server" imageurl="<%#Eval("Product_ID","~/Display.aspx?Product_ID={0}") %>" width="175" onmouseover="toggleImage(this)" xmlns:asp="#unknown" />


The toggleImage javascript function will replace the image source with desired value. A good article on this by ssar Khan
is here.

Regards,
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900