Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've been searching. Im trying to populate a list of videos with it's details. I've got no idea where to start and I've been searching and can't find anything for 3 weeks now.... What I am trying to accomplich is to have an image on the left with all its details on the right of it. Should I create a table for each listing and add that table to the list or is there a much more effecient and recomended way?

Basically on the left side it's the image then next to the image it will be title, description, size...

Can somebody please point me in the right direction? ...I'm struggling with no success...

EDIT:
C#
protected void Page_Load(object sender, EventArgs e)
        {
            var list = new List<string>();

            SqlCommand cmd;
            SqlDataReader rs = null;

            cn = new SqlConnection(GetConnectionString());
            string sql = "Select FileName, FilePath, Description FROM VideoInfo";

            try
            {
                cn.Open();
                cmd = new SqlCommand(sql, cn);
                cmd.CommandType = CommandType.Text;
                SqlDataReader myReader = cmd.ExecuteReader();

                if (myReader.HasRows)
                {
                    while (myReader.Read())
                    {
                        list.Add(myReader["FileName"].ToString() + " " + myReader["Description"].ToString());
                    }
                }
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                string msg = "Insert Error:";
                msg += ex.Message;
                throw new Exception(msg);
            }
            finally
            {
                cn.Close();
            }                
        }
Posted
Updated 21-May-13 2:00am
v3
Comments
Sunasara Imdadhusen 21-May-13 3:40am    
What you tried???
link_that 21-May-13 6:20am    
I tried adding them to a list, but the data does not display correct, everything is underneath each other.... I'm currently trying to add them to a table, but it is not ideal as no borders should be displayed... It should look as one item and not a table.....
link_that 21-May-13 3:53am    
I tried adding them to a list, but the data does not display correct, everything is underneath each other.... I'm currently trying to add them to a table, but it is not ideal as no borders should be displayed... It should look as one item and not a table.....
abhijeetgupta1988 21-May-13 6:13am    
Check this link:

http://baggit.com/BaggitMedia.aspx

Do you want something like this?
link_that 21-May-13 6:20am    
That was not exactly what I had in mind but that will work just as great! Maybe even better... But how was that done? Can you maybe explain to me please?

1 solution

We have stored the path of thumbnails,description ,etc in DB.

For rendering we have used Listview:
ASP.NET
<div title="Media List" class="LeftList">
                        <asp:ListView runat="server" ID="lvlist" DataKeyNames="RecordId">
                            <LayoutTemplate>
                                <div id="itemPlaceholder" runat="server" />
                            </LayoutTemplate>
                            <ItemTemplate>
                                <%--<asp:Image ID="ProductImage" runat="server"
                                   ImageUrl='<%#"~/images/media/" + 
                                       Eval("ThumbnailPhotoFileName") %>'
                                   Height="49" />--%>
                                   <br />
                                   <div style="height:70px;">
                                <asp:ImageButton id="imagebutton1" runat="server"
                                   AlternateText="ImageButton 1"
                                   ImageAlign="left" Width="120" Height="90px" style="margin-bottom:10px;  margin-left: 32px;"
                                   ImageUrl='<%#Eval("ImageUrl") %>'
                                   CommandArgument='<%#Eval("RecordId") %>'
                                   OnClick="ImageButton_Click"/></div>
                                   <br /> <br />
                                   <div style="text-align:justify; padding:2px 8px 2px 31px; width:120px;">
                                   <asp:Label ID="ltrTitle" runat="server" Text='<%#Eval("CommonTitle") %>' CssClass="ltrTitle" Width="120px" ></asp:Label><br />
                                   </div>
                                   <%--<asp:Literal ID="ltrTitle" runat="server" Text='<%#Eval("CommonTitle") %>'  />--%>
                            </ItemTemplate>
                        </asp:ListView>
 
Share this answer
 
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