D
David
Hi all,
Developing in VS 2005, VB.NET
An application I am working with currently has everything in one page, but
will really be suited to being modular, hence the idea of using dynamic user
controls.
When the page gets submitted, the submit button is on the page rather than
any user controls. So, the action of the submit needs to know about the user
control. I can handle this (mostly).
My UC has various text boxes. I am bringing them out as properties in the
UC. When I press submit, I can see the values in the properties just fine,
however, I don't think it is really that dynamic, as I have to declare the
UC prior to any page functions.
currently, I have...
Dim TravelUC = LoadControl(ResolveUrl("~/PathToUC"))
in my pageload I have
Panel.Controls.Add(TravelUC)
In my button submit I have...
label.Text = TravelUC.TextBoxValue() 'this is the property in the UC
which has TextBox.Text as its return value.
The way I would prefer is to be able to just load the UC based on certain
criteria. As it currently stands, my TravelUC will always be loaded, wether
being used or not. I can't do the loadcontrol in the pageload as the
TravelUC.TextBoxValue() is then not visible.
Any ideas on how I can have the UC loaded wherever/whenever I want it rather
than all the time?
Thanks.
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
Developing in VS 2005, VB.NET
An application I am working with currently has everything in one page, but
will really be suited to being modular, hence the idea of using dynamic user
controls.
When the page gets submitted, the submit button is on the page rather than
any user controls. So, the action of the submit needs to know about the user
control. I can handle this (mostly).
My UC has various text boxes. I am bringing them out as properties in the
UC. When I press submit, I can see the values in the properties just fine,
however, I don't think it is really that dynamic, as I have to declare the
UC prior to any page functions.
currently, I have...
Dim TravelUC = LoadControl(ResolveUrl("~/PathToUC"))
in my pageload I have
Panel.Controls.Add(TravelUC)
In my button submit I have...
label.Text = TravelUC.TextBoxValue() 'this is the property in the UC
which has TextBox.Text as its return value.
The way I would prefer is to be able to just load the UC based on certain
criteria. As it currently stands, my TravelUC will always be loaded, wether
being used or not. I can't do the loadcontrol in the pageload as the
TravelUC.TextBoxValue() is then not visible.
Any ideas on how I can have the UC loaded wherever/whenever I want it rather
than all the time?
Thanks.
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available