Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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:
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 20-May-13 21:46pm
Edited 21-May-13 3:00am
v3
Comments
Sunasara Imdadhusen at 21-May-13 3:40am
   
What you tried???
link_that at 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 at 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 at 21-May-13 6:13am
   
Check this link:
 
http://baggit.com/BaggitMedia.aspx
 
Do you want something like this?
link_that at 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?
link_that at 21-May-13 8:12am
   
Works great thanks so much!!!!
Sunasara Imdadhusen at 21-May-13 6:22am
   
Can you please provide snippet of code? so we can check and provide solution
link_that at 21-May-13 7:31am
   
I have added some code which I have tried, but not sure how to do this correctly with the video (display image of video/tumbnail)....

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

We have stored the path of thumbnails,description ,etc in DB.
 
For rendering we have used Listview:
<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>
  Permalink  
v2

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



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 21 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100