G
Guest
I have a user control that I am dynamically loading into an aspx page. When
I fill out the text boxes and submit the form using a command button on the
aspx page I lose the value from the user control. I have an Error-checking
function in the user control that I invoke from the aspx page. This method
fires and detects an error even though I fill the the text box with text.
Now, if I fill out the text box again with text everything goes smooth
sailing and I am able to continue. I am loading the user control using the
following methodology:
tenant_setup.scheduling.userbehaveproblems userBehaveProblem = new
tenant_setup.scheduling.userbehaveproblems();//form level variable declaration
userBehaveProblem = LoadControl ("userbehaveproblems.ascx") as
tenant_setup.scheduling.userbehaveproblems;//gets an instance of the control
pnlUserControl.Controls.Add (userBehaveProblem);//loads the control in the
panel
userBehaveProblem.HasErrors ();//the method call
I think it is a state problem, and I have the view state enabled. Any
suggestions?
I fill out the text boxes and submit the form using a command button on the
aspx page I lose the value from the user control. I have an Error-checking
function in the user control that I invoke from the aspx page. This method
fires and detects an error even though I fill the the text box with text.
Now, if I fill out the text box again with text everything goes smooth
sailing and I am able to continue. I am loading the user control using the
following methodology:
tenant_setup.scheduling.userbehaveproblems userBehaveProblem = new
tenant_setup.scheduling.userbehaveproblems();//form level variable declaration
userBehaveProblem = LoadControl ("userbehaveproblems.ascx") as
tenant_setup.scheduling.userbehaveproblems;//gets an instance of the control
pnlUserControl.Controls.Add (userBehaveProblem);//loads the control in the
panel
userBehaveProblem.HasErrors ();//the method call
I think it is a state problem, and I have the view state enabled. Any
suggestions?