Dynamically Added User Control not accessible!
I am building a dynamic contact form (similar to outlook) and each
component is different user control e.g Phonenumber, email address.
This all works fine to display the information.
The Main User Control Form loads the contact name information then for
every phone number the contact has, a PhoneNumber user control is
added to the form and filled with information. The user can alter the
phoneNumbers (or other information) press the main form Save button
and all the new info is saved.
I also have a NEW button which when clicked adds a new empty
PhoneNumber control to the page and the user can enter information.
After adding a new PhoneNumber control and pressing the save button, I
am unable to access the new phone number control either by name or
type from within the Save button function.
In the Page trace I can see the new control in the controls array
before I press the Save button, but through VS.NET debug SAVE function
it appears as an undefined System.Web.UI.Control and I can not access
the values to save them.
Is there something else I have to do when adding usercontrols on a
CODE USED TO ADD CONTROL
hdrCtl = LoadControl("PhoneNumber.ascx");
if (hdrCtl != null)
catch (Exception ex)
|All times are GMT. The time now is 07:01 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.