G
guoqi zheng
Dear Sir,
I have a menu page (main.aspx") with a placeholder on it. This placeholder
will load a a main menu item user controls (mainmenu.ascx), on this page,
there are a few menu items, When user clicks one of those menu items,
placeholder will be clean and load another user control (e.g. uc1test.ascx).
I have below code on click event at mainmenu.ascx, obviously these code did
not work out. What did I do wrong here?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.
EventArgs) Handles Button1.Click
Dim abc As PlaceHolder = CType(FindControl("PlaceHolder1"), PlaceHolder)
Dim uctest1 As Control = LoadControl("uc1test.ascx")
abc.Controls.Clear()
abc.Controls.Add(uctest1)
End Sub
Regards,
Guoqi Zheng
http://www.ureader.com
I have a menu page (main.aspx") with a placeholder on it. This placeholder
will load a a main menu item user controls (mainmenu.ascx), on this page,
there are a few menu items, When user clicks one of those menu items,
placeholder will be clean and load another user control (e.g. uc1test.ascx).
I have below code on click event at mainmenu.ascx, obviously these code did
not work out. What did I do wrong here?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.
EventArgs) Handles Button1.Click
Dim abc As PlaceHolder = CType(FindControl("PlaceHolder1"), PlaceHolder)
Dim uctest1 As Control = LoadControl("uc1test.ascx")
abc.Controls.Clear()
abc.Controls.Add(uctest1)
End Sub
Regards,
Guoqi Zheng
http://www.ureader.com