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. Using Jquery in DataList

Using Jquery in DataList

Scheduled Pinned Locked Moved ASP.NET
helpjavascripthtmlsysadmintools
2 Posts 2 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.
  • M Offline
    M Offline
    mrkeivan
    wrote on last edited by
    #1

    Hey guys, I'm new to Jquery and I'm trying to use <pre>jCapSlide</pre> in a datalist,

    <pre lang="HTML">
    <asp:DataList ID="DataListList" runat="server" DataSourceID="ObjectDataSourceList"
    RepeatColumns="5" CellPadding="5" CellSpacing="5"
    OnItemDataBound="DataListList_ItemDataBound">
    <ItemTemplate>
    <div id="capslide_img_cont" class="ic_container">
    <asp:Image ImageUrl='<%#Eval("Images.Image.Virtual_FileName") %>' ID="MainImage"
    CssClass="NewsImage1" runat="server" />
    <div class="overlay" style="display: none;">
    </div>
    <div class="ic_caption">
    <p class="ic_category">
    '<%# Eval("Category.cName")%>'</p>
    <h3>
    '<%# Eval("pTitle") %>'</h3>
    <p class="ic_text">
    '<%# Eval("pTitle") %>'
    </p>
    </div>
    </div>
    </ItemTemplate>
    </asp:DataList>
    </pre>

    with this Function

    <pre lang="Javascript">
    <script type="text/javascript">
    $(function () {
    $("#capslide_img_cont").capslide({
    caption_color: 'white',
    caption_bgcolor: 'black',
    overlay_bgcolor: 'black',
    border: '',
    showcaption: false
    });
    });
    </script>
    </pre>

    There are 3 records, this applies on the first one but not the other two,
    I think the problem is repeated <pre>id="capslide_img_cont"</pre> but can't seem to fix it.
    can you help me out ?
    It's deeply appreciated

    A 1 Reply Last reply
    0
    • M mrkeivan

      Hey guys, I'm new to Jquery and I'm trying to use <pre>jCapSlide</pre> in a datalist,

      <pre lang="HTML">
      <asp:DataList ID="DataListList" runat="server" DataSourceID="ObjectDataSourceList"
      RepeatColumns="5" CellPadding="5" CellSpacing="5"
      OnItemDataBound="DataListList_ItemDataBound">
      <ItemTemplate>
      <div id="capslide_img_cont" class="ic_container">
      <asp:Image ImageUrl='<%#Eval("Images.Image.Virtual_FileName") %>' ID="MainImage"
      CssClass="NewsImage1" runat="server" />
      <div class="overlay" style="display: none;">
      </div>
      <div class="ic_caption">
      <p class="ic_category">
      '<%# Eval("Category.cName")%>'</p>
      <h3>
      '<%# Eval("pTitle") %>'</h3>
      <p class="ic_text">
      '<%# Eval("pTitle") %>'
      </p>
      </div>
      </div>
      </ItemTemplate>
      </asp:DataList>
      </pre>

      with this Function

      <pre lang="Javascript">
      <script type="text/javascript">
      $(function () {
      $("#capslide_img_cont").capslide({
      caption_color: 'white',
      caption_bgcolor: 'black',
      overlay_bgcolor: 'black',
      border: '',
      showcaption: false
      });
      });
      </script>
      </pre>

      There are 3 records, this applies on the first one but not the other two,
      I think the problem is repeated <pre>id="capslide_img_cont"</pre> but can't seem to fix it.
      can you help me out ?
      It's deeply appreciated

      A Offline
      A Offline
      AmitGajjar
      wrote on last edited by
      #2

      Instead of using Div id you can use Class to apply your jquery like,

      $(".ic_container").capslide({.....

      This may work for you.

      Thanks -Amit Gajjar (MinterProject)

      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