unable to use user controls from code in App_Code

A

anujit.basu

Hi,

Newbie here.

I have a couple of user controls (yes, header and footer) in a
directory "Controls" that are working properly in a web page when used
declaratively.

I am now trying to use the controls in a c# file in the App_Code
directory, and the two user controls are out of scope.

The @ Control directive for the user controls in the looks like:

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

What I can figure out that the class is called MyHeader, and I have
included the project's default namespace in the using block, but still
no resolution.

What am I doing wrong?

Thanks for any help.

/Anujit
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top