Nilesh Patil

Nilesh Patil

  • NA
  • 3k
  • 116.2k

how to assign string value to repeater label

Nov 17 2017 2:06 AM
Hi,
 
I am try to assign string value to repeater control but it gives error Object refernce not set to an insant of object.
 
Below is my code
 
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;
}

Answers (1)