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


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