Subject: Dynamic user control- not able to set values
Posted By: ghari Post Date: 1/4/2006 12:16:02 AM
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

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!



Go to topic 38237

Return to index page 404
Return to index page 403
Return to index page 402
Return to index page 401
Return to index page 400
Return to index page 399
Return to index page 398
Return to index page 397
Return to index page 396
Return to index page 395