Link to home
Start Free TrialLog in
Avatar of SimpleDude
SimpleDude

asked on

Calling ASCX user control randomly

Hello, I've a user control I register as follows:

<%@ Register TagPrefix="db" TagName="Banner" Src="~/Banner.ascx" %>

and I call it this way when I need it:

<db:Banner ID="Banner1" runat="server" />


My problem is that the file Im registering (banner.ascx) is not always the same.

Each customer may display a different file, as banner.ascx, or banner2.ascx, etc

The file name is stored on a session variable called banner, so when I try this:

<%@ Register TagPrefix="db" TagName="Banner" Src="~/<%=session("banner")%>" %>

I obviously get an error.

Is there a workaround to assign the name of the user control file randomly?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of jitendra patil
jitendra patil
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SimpleDude
SimpleDude

ASKER

Thanks!