1
Answer

how to assign string value to repeater label

Nilesh Patil

Nilesh Patil

6y
171
1
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)