我想要做的是我想将我得到的响应绑定到转发器控件。在响应中有名称、问题、免责声明等字段。我想将这些字段数据绑定到转发器中的控件。
我正在做的是:
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 =
}
}
这就是我的响应的创建方式:
public List<CustomizationListCustomization> GetPackageCustomization(string PackageCode)
{
List<CustomizationListCustomization> arrCusts = SiteConfiguration.customizationList.Customization.Where(cust => cust.PackageList.Contains(PackageCode)).ToList();
return arrCusts;
}
但我找不到任何结果。有什么建议我怎么能做到这一点?