foreach (DataRow dRow in dt_OwnerFilter.Rows)
{
if (dt_OwnerFilter.Rows.Count > 0)
{
string htmlcode = "";
htmlcode = "<a class='btn btn-primary' onclick='fnShow(" + dRow["PropertyDetailsId"] + ")'> " + i + "</a>";
Label status = (Label)b.NamingContainer.FindControl("lbldata");
status.Text += htmlcode + "<br>"; //Here is error
}
i = i + 1;
}