So far this is what I have.
protected void CategoryRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Object dataItem = e.Item.DataItem;
// code to pull catid out of dataItem
}
Here's an example of what dataItem contains after running in debug:
dataItem = { TextCategory = "Radiation (Release or Contamination)", catid = 4, TextResult = "Refer to emergency plan and report under code 332.54(A)" , IsReportable = True }
I want to pull the catid out of the object. I have tried casting it, but all attempts to cast it have been unsuccessful. My goal is to use this catid for a nested repeater's databind.. something like this:
using (NERAEntities entities = new NERAEntities())
{
var Questions = (from x in entities.Questions
where x.CategoryID == catid
select new { QuestionText = x.Text });
QARepeater.DataSource = Questions;
QARepeater.DataBind();
}