video post using literal
<div class="pl-5 ptb-5 pl-sm-0 pos-relative h-50">
<a class="pos-relative h-100 dplay-block" href="#">
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1"
RepeatDirection="Horizontal" >
<ItemTemplate>
<asp:Literal ID="Literal2" runat="server" Text='<%# Eval("url") %>'></asp:Literal>
</a>
<div class="abs-blr color-white p-20 bg-sm-color-7">
<h4 class="mb-10 mb-sm-5">
<b>Live TV</b></h4>
<%--<ul class="list-li-mr-20">
<li>Jan 25, 2018</li>
<li><i class="color-primary mr-5 font-12 ion-ios-bolt"></i>30,190</li>
<li><i class="color-primary mr-5 font-12 ion-chatbubbles"></i>30</li>
</ul>--%>
</div>
</ItemTemplate>
</asp:DataList>
<!--abs-blr -->
<!-- pos-relative -->
</div>
<!-- w-1-3 -->
</a>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:abcdbConnectionString3 %>"
SelectCommand="SELECT * FROM [livenewsdb1]"></asp: SqlDataSource>
</div>
protected void btnlivenews_Click(object sender, EventArgs e)
{
if (txtliveurl.Text == "")
{
ScriptManager. RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:alert('Please input fields')", true);
}
else
{
//delete
string cs1 = ConfigurationManager. AppSettings["abcdb"];
cn = new SqlConnection(cs1);
cn.Open();
string k2 = "delete from livenewsdb1";
cm1 = new SqlCommand(k2, cn);
cm1.ExecuteNonQuery();
//insert
string status = "N/A";
String link = "<embed width = \"450\" height = \"190\" src = \"https://www.youtube.com/ embed/" + txtliveurl.Text + "\" frameborder=\" 0 \" allowfullscreen></embed>";
String query = "insert into livenewsdb1(datepost,url, status) values('" + txtdate.Text + "','" + link + "',N'" + status + "')";
string cs = ConfigurationManager. AppSettings["policediarydb"];
cn = new SqlConnection(cs);
cn.Open();
SqlCommand cm = new SqlCommand();
cm.CommandText = query;
cm.Connection = cn;
cm.ExecuteNonQuery();
txtliveurl.Focus();
txtliveurl.Text = "";
}
}
}