|
-
Apr 13th, 2005, 09:19 AM
#1
Loading a control within a control
I'm very very tired, I might be overlooking something.
On a page named default.aspx, I have placed a control called LeftMenu.ascx.
Now, leftmenu.ascx itself is empty, but in its codebehind, depending upon the a certain Session variable's value, I am trying to load LeftMenuSuper.ascx or LeftMenuHeader.ascx. So, that's a control within a control.
Here is the code in LeftMenu.ascx.vb:
VB Code:
If Session.Item(0).ToString = "normaluser" Then
Me.LoadControl("LeftMenuNormal.ascx")
Else
Me.LoadControl("LeftMenuSuper.ascx")
End If
The problem is, nothing happens. The area where the menu is supposed to be just stays blank, and yes, both of these "child" ascx files contain HTML.
(This is all experimental, so we won't talk about good or bad practices here.)
Help me out, what am I doing or not doing?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|