Need to make a class in a master page usable on all content pages.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm pretty new to C# so please be gentle.

I want to declare a variable for a user's "displayName" pulled from Active
Directory based on login. I've gotten this working on a regular aspx page
just fine with the code being put in a codefile behind the main page.

What I want to do now is put this class behind a master page so I can
declare the output as a variable and display the output on other pages in the
site. I'd apreciate any help you guys can provide.

Thanks,
Jester
 
I'm very sorry in advance for this. I have a background in mostly PHP.
Could you possibly show me how to move this code to a user control? I've
actually never done that before. I appreciate any information you can
provide. And I assume a user control is portable to all pages in a site?

Thanks,
JASON
 
User Controls are fairly easy to grasp. This worked for me Jester...

google: create user control c# site:microsoft.com

You will also need to learn how to reference the controls that are children
of your user control so keep your eyes open for that context as you study
the documentation.

<%= 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

Back
Top