Thanks, I did go through that Wiki article which lead to http://www.visualwebgui.com/Developers/KB/tabid/654/article/working_with_usercontrols_to_simulate_frames/Default.aspx
The sample project had too many errors when i tried to load it in vs2010 VWG 4 so I just gave up. Even if you can't give me code can you explain the concept of how to do it?
Also, does the UserControl need to be a part of the VWG project or can it be part of a VWG library project? Does it matter if it is in a library project?
One last thing. The usercontrol would have to interact alot with the form that contains it. How do you do the event handling in the main form if the user control is being swapped in?
As I have said before, I am new to .net and to VWG. The application that I am building is for a rewrite of an existing asp classic application that is of a pretty good size. I don't have the luxury of time in the rewrite so please understand why I am posting questions like a mad man !
Thanks,
Shawn
----- Update 5:35pm ------
I have made it work but I am afraid that I am missing something because it is reatively simple.
On my form I have a panel (panel1)
I have created a user control (usercontrol1)
In the main form is a button with a click event. That event looks like this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Panel1.Controls.Clear()
Me.Panel1.Controls.Add(oControl)
oControl.MyTest = "help me"
oControl.LoadMe()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Panel1.Controls.Clear()
Me.Panel1.Controls.Add(oControl2)
End Sub
The control is dimmed at the class level with this code
Dim oControl As New UserControl1
Dim oControl2 As New UserControl2
I did this so that I could interact with the control throughout the life of the form.
2 questions remain:
1. Is this a good approach? Or am I asking for trouble with this simple approach? I am planning on less then 5 user controls that would be handled like this (those controls will have a number of controls within them). Each of these controls will be loading alot of data. What data will be based off information passed to the usercontrols from the main form so I will have some sort of loaddata function in the usercontrol.
2. How do I handle events in the usercontrol so that they will kick off functions in the main form?
Thanks for any insight.
Shawn