Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. binding table data with img tag instead of image control in asp.net

binding table data with img tag instead of image control in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netdatabasewpf
11 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 7946595
    wrote on last edited by
    #1

    hi, what i want:- bind database value in .aspx page in a data control like datalist but i want to apply jquery on it bcaz want to show effects on it The Problem :-downloaded jquery only works with img tag but in datalist i can use image control so....jquery is not working is there any way for 1. binding database values with img tag instead of image control OR 2. can jquery work with img control if anybody knows pls pls reply me thnkxx in advance

    E M A 3 Replies Last reply
    0
    • U User 7946595

      hi, what i want:- bind database value in .aspx page in a data control like datalist but i want to apply jquery on it bcaz want to show effects on it The Problem :-downloaded jquery only works with img tag but in datalist i can use image control so....jquery is not working is there any way for 1. binding database values with img tag instead of image control OR 2. can jquery work with img control if anybody knows pls pls reply me thnkxx in advance

      E Offline
      E Offline
      Elham M
      wrote on last edited by
      #2

      your question isn't clear you want to set src of image that come from database?

      U 1 Reply Last reply
      0
      • U User 7946595

        hi, what i want:- bind database value in .aspx page in a data control like datalist but i want to apply jquery on it bcaz want to show effects on it The Problem :-downloaded jquery only works with img tag but in datalist i can use image control so....jquery is not working is there any way for 1. binding database values with img tag instead of image control OR 2. can jquery work with img control if anybody knows pls pls reply me thnkxx in advance

        M Offline
        M Offline
        m dhu
        wrote on last edited by
        #3

        Member 7980675 wrote:

        binding database values with img tag instead of image control

        For asp.net Image control path is given to ImageUrl

        <asp:Image ID="img1" runat="server" ImageUrl='<%# Eval("path") %>'></asp:Image>

        For HTML img path is set to src

        U 1 Reply Last reply
        0
        • U User 7946595

          hi, what i want:- bind database value in .aspx page in a data control like datalist but i want to apply jquery on it bcaz want to show effects on it The Problem :-downloaded jquery only works with img tag but in datalist i can use image control so....jquery is not working is there any way for 1. binding database values with img tag instead of image control OR 2. can jquery work with img control if anybody knows pls pls reply me thnkxx in advance

          A Offline
          A Offline
          Ali Al Omairi Abu AlHassan
          wrote on last edited by
          #4

          Sir; Dose m@dhu's answer solve your problem?

          Help people,so poeple can help you.

          U 1 Reply Last reply
          0
          • E Elham M

            your question isn't clear you want to set src of image that come from database?

            U Offline
            U Offline
            User 7946595
            wrote on last edited by
            #5

            hi, my prob is that i want to implement jquery on images bt images are in database. i can bind them and able to show with image control but the problem is that jquery is not working in image control. it works with img tag

            1 Reply Last reply
            0
            • M m dhu

              Member 7980675 wrote:

              binding database values with img tag instead of image control

              For asp.net Image control path is given to ImageUrl

              <asp:Image ID="img1" runat="server" ImageUrl='<%# Eval("path") %>'></asp:Image>

              For HTML img path is set to src

              U Offline
              U Offline
              User 7946595
              wrote on last edited by
              #6

              hello, thanz for this but my prob is that i want to implement jquery on images bt images are in database. i have done this with image control but the problem is that jquery is not working in image control. it works with img tag

              A 1 Reply Last reply
              0
              • A Ali Al Omairi Abu AlHassan

                Sir; Dose m@dhu's answer solve your problem?

                Help people,so poeple can help you.

                U Offline
                U Offline
                User 7946595
                wrote on last edited by
                #7

                have replied sir .....:)

                1 Reply Last reply
                0
                • U User 7946595

                  hello, thanz for this but my prob is that i want to implement jquery on images bt images are in database. i have done this with image control but the problem is that jquery is not working in image control. it works with img tag

                  A Offline
                  A Offline
                  Ali Al Omairi Abu AlHassan
                  wrote on last edited by
                  #8

                  please send me the HTML and the behind code you tried on.

                  Help people,so poeple can help you.

                  U 1 Reply Last reply
                  0
                  • A Ali Al Omairi Abu AlHassan

                    please send me the HTML and the behind code you tried on.

                    Help people,so poeple can help you.

                    U Offline
                    U Offline
                    User 7946595
                    wrote on last edited by
                    #9

                    in .aspx page... <asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="4" RepeatLayout="Table" CellPadding="5" CellSpacing="10" onitemcommand="DataList1_ItemCommand" > <ItemTemplate> <div> <%--<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%#Eval("image_name") %>' height="200" width="120" BorderColor = "#FFCC01" BorderStyle = "outset" BorderWidth = "8" CommandName="img" CommandArgument = '<%#Eval("image_id") %>'/>--%> <p><img id="image1" runat="server" border="0" src='<%#Eval("image_name") %>' style="border-color:#FFCC01;border-style:outset;border-width:8px;" height="200" width="120" /><p> <br /> </div> </ItemTemplate> </asp:DataList> in this page i want jquery on img tag...and in that it takes src value of img tag and zoom it bt in case of eval function its not working..... is simple word if i use simple img tag and give value of any image then jquery is working fine bt wen i give eval function bcaz images are in database then jquery is not working.....

                    A 1 Reply Last reply
                    0
                    • U User 7946595

                      in .aspx page... <asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="4" RepeatLayout="Table" CellPadding="5" CellSpacing="10" onitemcommand="DataList1_ItemCommand" > <ItemTemplate> <div> <%--<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%#Eval("image_name") %>' height="200" width="120" BorderColor = "#FFCC01" BorderStyle = "outset" BorderWidth = "8" CommandName="img" CommandArgument = '<%#Eval("image_id") %>'/>--%> <p><img id="image1" runat="server" border="0" src='<%#Eval("image_name") %>' style="border-color:#FFCC01;border-style:outset;border-width:8px;" height="200" width="120" /><p> <br /> </div> </ItemTemplate> </asp:DataList> in this page i want jquery on img tag...and in that it takes src value of img tag and zoom it bt in case of eval function its not working..... is simple word if i use simple img tag and give value of any image then jquery is working fine bt wen i give eval function bcaz images are in database then jquery is not working.....

                      A Offline
                      A Offline
                      Ali Al Omairi Abu AlHassan
                      wrote on last edited by
                      #10

                      I think that there is no differences between both case, because image src would be rendered in the same way. What I think is you used image ids in the jquery selector. try this:

                      <asp:DataList ID="DataList1" runat="server"
                      RepeatDirection="Horizontal"
                      RepeatColumns="4"
                      CellPadding="5"
                      CellSpacing="10"

                      <ItemTemplate>
                          <div>
                          <p><img id="image1" runat="server" border="0" src='<%#Eval("image\_name") %>' style="border-color:#FFCC01;border-style:outset;border-width:8px;" height="200" width="120" /><p>
                          <br />
                          </div>
                      </ItemTemplate>
                      

                      </asp:DataList>

                      <script type="text/javascript">
                      $(document).ready( function() {
                      $("#<%= DataList1.ClientID %> img").animate();
                      });
                      </script>

                      We used the selector $("#<%= DataList1.ClientID %> img") beacase the markups would be renderer as

                      <table id="DataList1.ClientID">
                      <tr><td>
                      <img id="DataList1.ClientID_ctr100_Image1" ... />
                      </td> ... </tr>
                      ...

                      </table>

                      Good luck ;)

                      Help people,so poeple can help you.

                      U 1 Reply Last reply
                      0
                      • A Ali Al Omairi Abu AlHassan

                        I think that there is no differences between both case, because image src would be rendered in the same way. What I think is you used image ids in the jquery selector. try this:

                        <asp:DataList ID="DataList1" runat="server"
                        RepeatDirection="Horizontal"
                        RepeatColumns="4"
                        CellPadding="5"
                        CellSpacing="10"

                        <ItemTemplate>
                            <div>
                            <p><img id="image1" runat="server" border="0" src='<%#Eval("image\_name") %>' style="border-color:#FFCC01;border-style:outset;border-width:8px;" height="200" width="120" /><p>
                            <br />
                            </div>
                        </ItemTemplate>
                        

                        </asp:DataList>

                        <script type="text/javascript">
                        $(document).ready( function() {
                        $("#<%= DataList1.ClientID %> img").animate();
                        });
                        </script>

                        We used the selector $("#<%= DataList1.ClientID %> img") beacase the markups would be renderer as

                        <table id="DataList1.ClientID">
                        <tr><td>
                        <img id="DataList1.ClientID_ctr100_Image1" ... />
                        </td> ... </tr>
                        ...

                        </table>

                        Good luck ;)

                        Help people,so poeple can help you.

                        U Offline
                        U Offline
                        User 7946595
                        wrote on last edited by
                        #11

                        hello sir, yuppppiiiiii it worked....thanxxx a lot m so happy..thanku so much for ur reply........ u really helped me thankss to all

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups