Hello experts,
For Last few days I'm stuck with a user control. Would like to appriciate if some one could get me out from the hazzard.
My problem.
I have a user control with some text boxes and drop down list.
(It is a "from" date select , a "to" date select and a price text box)
I need this user control to repeat untill the number of records in a table.
So I tried dynamically loading the user control and have used the following code
Code:
for(iLoop = 1;iLoop<=iSeasonCount;iLoop++)
{
objSeason = LoadControl("UserCtrls/seasons.ascx");
objSeason.ID = "Seasons" + iLoop;
dvSeasons.Controls.Add(objSeason);
objSeason.Dispose();
}
And this code is very well displaying the controls on the page.
But the problem is that
Im not able to set values to the user control feilds from the parent page.
I have already converted the protected control objects in the user control to public.
I'm able to assign the values when im placing the control in the aspx page as a tag.
I have tried with find control method as well.
I hope someone will be there to help me out.
Thanks in Advance!