ListViewVideo.aspx
ListViewVideo.aspx.cs
private void BindGrid()
{
string strConnString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlCommand cmd = new SqlCommand())
{
cmd.CommandText = "select Id, Name from tblFiles";
cmd.Connection = con;
con.Open();
DataList1.DataSource = cmd.ExecuteReader();
DataList1.DataBind();
con.Close();
}
}
}
Hi,
I am using LISTVIEW concept,In this i am displaying the Image in LISTVIEW
by clicking the Image the video will play using tag
Each image i am using separate video by ADD--> Existing Item--> SELECT VIDEO
There is a problem
I am retrieving the video from database it should display in LISTVIEW
ANY SOLUTION.?
HELP
11 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Shubham KumarPosted Apr 13, 2015, 9:30 AM
Khargesh RajputPosted Apr 13, 2015, 2:35 AM
foreach (ListViewDataItem item in Listview1.Items) {
DataList DataList1= item.FindControl("DataList1");
//bind here datalist
}
}
Deepak RatanPosted Apr 13, 2015, 2:26 AM
Its not working,
There is a problem in playing the Video from database
Deepak RatanPosted Apr 13, 2015, 2:25 AM
Its showing error in sender
ListViewDataItem item = (ListViewDataItem)(senderasControl).NamingContainer;DataList dt= (DataList)item.FindControl("DataList1");Khargesh RajputPosted Apr 13, 2015, 2:09 AM
DataList DataList1= (DataList)item.FindControl("DataList1");
//then bind data in DataList1
Shubham KumarPosted Apr 13, 2015, 1:59 AM
<%# Eval("Post_Name") %>
Name of Post: <%# Eval("Designation") %>
Deepak RatanPosted Apr 13, 2015, 1:57 AM
The ID name is showing in ListViewVideo.aspx.cs
Deepak RatanPosted Apr 13, 2015, 1:52 AM
Thanks for your Reply,
Tried but getting same ERROR
ERROR: The name 'DataList1' does not exist in the current context
Deepak RatanPosted Apr 13, 2015, 1:47 AM
Thanks for your Reply,
Do you have source code to solve this Issue?
Shubham KumarPosted Apr 13, 2015, 1:45 AM
<%# Eval("Name") %>
instead of your code you are using only tag that's why its not showing
Khargesh RajputPosted Apr 13, 2015, 1:43 AM
DataList1
inside any control means is it nested control
then you have to find child control inside parent control