Hi, i have a Repeater control within a FormView. What i need to do is when you insert a record pass the values from the TextBox (id is txtControl) within each row of the Repeater to my insert method. I have the following event handler for my ObjectDataSource's OnInserting event:
The problem i have is that the Text property of txtControl keeps returning empty. The funny thing is that i had this working a while back but made some changes and now it no long works. Appreciate if someone could help. Thanks
Code:
protected void objDocument_Inserting(object sender, System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs e)
{
Hashtable values = new Hashtable();
Repeater rptAttributes = (Repeater)fvwDocument.FindControl("rptAttributes");
List<AttributesItem> attributes = this.GetAttributes();
for (int i = 0; i <= attributes.Count - 1; i++)
{
values.Add(attributes[i].AttributeName, ((TextBox)rptAttributes.Items[i].FindControl("txtControl")).Text);
}
}
e.InputParameters.Add("values", values);
}
The problem i have is that the Text property of txtControl keeps returning empty. The funny thing is that i had this working a while back but made some changes and now it no long works. Appreciate if someone could help. Thanks