I'm trying to create a gallery using ASP.net and SQL Server database, but the images are just displaying in a list. I think the problem is that I am not connecting to the jQuery successfully. Below is the C# code which retrieves the Image's path in the Images folder.

String strConnString = System.Configuration.ConfigurationManager.ConnectionStrings["BallinoraDBConnectionString1"].ConnectionString;
    SqlConnection con = new SqlConnection(strConnString);
    con.Open();

    //Query to get ImagesName and Description from database
    SqlCommand command = new SqlCommand("SELECT ImageName,Description from SlideShowTable Where Event_Group_Id = 1", con);
    SqlDataAdapter da = new SqlDataAdapter(command);
    DataTable dt = new DataTable();
    da.Fill(dt);
    rptImages.DataSource = dt;
    rptImages.DataBind();
    con.Close();       

Below is the HTML which displays the images. As I said, they are appearing in a simple list which I think means they are not connected to the CSS or JavaScript.

<div class="container">
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <script type="text/javascript" src="http://cdn.jsdelivr.net/jcarousel/0.2.8/jquery.jcarousel.min.js"></script>
        <link href="http://cdn.jsdelivr.net/jcarousel/0.2.8/skins/tango/skin.css" rel="Stylesheet" />
        <script type="text/javascript">
            $(function () {
                $('#mycarousel').jcarousel();
            });
        </script>
        <ul id="mycarousel" class="jcarousel-skin-tango">
            <asp:Repeater ID="rptImages" runat="server">
                <ItemTemplate>
                    <li>
                        <a id="imageLink" href='<%# Eval("ImageName","~/SlideImages/{0}") %>' title='<%#Eval("Description") %>' rel="lightbox[Brussels]" runat="server">
                            <asp:Image ID="Image1" ImageUrl='<%# Bind("ImageName", "~/SlideImages/{0}") %>' runat="server" Width="112" Height="84" />
                        </a>
                    </li>
                </ItemTemplate>
            </asp:Repeater>
        </ul>
    </div>

I'd appreciate any guidance you guys could give.

Also, here is the code which I have adapted to fit my own. I pasted this exact code across beforehand, and it didn't work as expected.

These are the error messages I am receiving when I Ctrl + Shft + J.

Related posts

Recent Viewed