UserControls in ASP.NET 2.0

G

Guest

Hi,

I am new to ASP having previously been doing Java.

I think User Controls are good but I have problem that I cannot solve -
spent a long time searching the

web without so far much success.

The problem:

I am using a UserControl to display a company log on the page with the
thought that if the logo changes I

can change the view on the Web site without having to alter any code.

However our site is to be marketed to different companies who will want to
see their own logo on the

page.

The original UserControl ascx file merely delivers the logo in an img tag.

My goal is to allow the following:

Example: User (a) logs and sees the logo for the company they work for
User (b) logs into the same site but sees a different logo as
they work for
a different company.

I am attempting to do this programmatically but failing at the moment.

Is it possible to alter the ascx file called for each user within the .cs
file Page_Load method?

My master file has:

<%@ Register Src="UserControls/ClientIcon.ascx" TagName="ClientIcon"
TagPrefix="uc1" %>

....
<body>
....
<uc1:ClientIcon ID="ClientIcon1" runat="server" />
....
</body>

Each separate ascx file has:

<%@ Control Language="C#" ClassName="ClientIcon" AutoEventWireup="true"
CodeFile="ClientIcon.ascx.cs"

Inherits="UserControls_ClientIcon" %>
<div>
<img src="images/[name of logo gif file]" width="280" height="91"
alt="Client image" border="0"

class="ClientIcon">
</div>

Hope this is understandable - can anyone help please.

Thanks in advance

Andrew

P.S If this is the wrong way please let me know - thanks
 
C

clintonG

First of all, there is an AdRotator Control in the framework you may find
useful. Secondly, you should be using ASP.NET 2.0 Membership, Roles and
Profiles to manage authentication, what is or is not displayed and to whom.
These two recommendations will enable you to provide an elegant solution.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top