dynamically displaying .ascx files

  • Thread starter Thread starter BK Kim
  • Start date Start date
B

BK Kim

Hello.

I have made some .ascx files which displays some data.

What I am trying to do is in my .aspx file, I dynamically display a.ascx
file or b.ascx file depend on who logs in.

Is there any way I can achieve this?

Thanx in advance
 
If you only have two controls that need to be swapped out, simply set the
Visible property according to what you want displayed.
 
BK said:
Hello.

I have made some .ascx files which displays some data.

What I am trying to do is in my .aspx file, I dynamically display
a.ascx file or b.ascx file depend on who logs in.

Is there any way I can achieve this?

Thanx in advance

Apart from Peter's solution (which is easier if you need post back
from your user control), this is another way (VB):

If(user="John") Then
Dim c1 As Control = LoadControl("a.ascx")
Page.Controls.Add(c1)
Else
....
End If
 
Back
Top