使用右侧的详细信息填充视频 [英] populate videos with details on the right

查看:92
本文介绍了使用右侧的详细信息填充视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找。我试图用它的详细信息填充视频列表。我不知道从哪里开始,我一直在寻找,现在已经找不到任何东西了3个星期......我想要的是,我想要的是左边有一个图像及其所有细节在它的右边。我应该为每个列表创建一个表格并将该表格添加到列表中还是有更有效和推荐的方式?



基本上在左侧它'' s图像然后在图像旁边它将是标题,描述,大小...



有人可以指出我正确的方向吗? ......我没有成功挣扎......



编辑:

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...


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();
            }                
        }

推荐答案

我们在DB中存储了缩略图,描述等的路径。 />


对于渲染,我们使用了Listview:

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>

这篇关于使用右侧的详细信息填充视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆