By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,706 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,706 IT Pros & Developers. It's quick & easy.

Error when trying to access User Control

P: n/a
I'm getting a weird error when trying to access a user control from
within a base page during runtime. Here's what I have:

I have a master page with a user control on it. I then have a few
webforms that provide content to the master page. All of these
webforms inherit from the same basepage which I created. Within that
base page I'm attempting to access the user control. When I try to
execute the code, it gives me an error:

"CS0246: The type or namespace name 'UserControls_MyControl' could not
be found (are you missing a using directive or an assembly reference?)"

at the point that I declare a variable of the type
UserControls_MyControl.

But during design time, it has no problem finding that class (it
doesn't show as an error and the intellisense comes up). Does anyone
know what I'm missing here???

Mar 31 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
is this in 2005?

You need to add a @Reference directive

<%@ Reference Control="yourcontrol.ascx" %>

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
<ti****@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
I'm getting a weird error when trying to access a user control from
within a base page during runtime. Here's what I have:

I have a master page with a user control on it. I then have a few
webforms that provide content to the master page. All of these
webforms inherit from the same basepage which I created. Within that
base page I'm attempting to access the user control. When I try to
execute the code, it gives me an error:

"CS0246: The type or namespace name 'UserControls_MyControl' could not
be found (are you missing a using directive or an assembly reference?)"

at the point that I declare a variable of the type
UserControls_MyControl.

But during design time, it has no problem finding that class (it
doesn't show as an error and the intellisense comes up). Does anyone
know what I'm missing here???

Mar 31 '06 #2

P: n/a
Yes, it is

Mar 31 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.