Bind a List data to repeater control
What i want to do is i want to bind the response that i`m getting to the
repeater control. In the response there are fields for Name, Question,
Disclaimer etc. I want to bind these field data to the controls in the
repeater.
What i`m doing is :
protected void rptCustInfo_ItemDataBound(object sender,
RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Header)
{
Label headertext = new Label();
headertext = e.Item.FindControl("lblHeaderText") as Label;
//headertext.Text = custInfo.CustomizationName;
Label questiontext = new Label();
questiontext = e.Item.FindControl("lblQuestionText") as
Label;
//questiontext.Text = custInfo.QuestionText;
//headertext.Text = "";
//headertext.Text =
}
}
This is how my response is created:
public List<CustomizationListCustomization> GetPackageCustomization(string
PackageCode)
{
List<CustomizationListCustomization> arrCusts =
SiteConfiguration.customizationList.Customization.Where(cust =>
cust.PackageList.Contains(PackageCode)).ToList();
return arrCusts;
}
But I cannot find any result. any suggestions how can i achieve this ?
No comments:
Post a Comment