Protected WithEvents Question

B

Benign Vanilla

I am a ASP.NET newbie so please bear with me.

I had a series of webforms working on my web site, and then I made some
tragic error that is causing all kinds of problems. The main symptom is that
when I try to declare a control in my code, I can no longer reference the
proper type.

The old code looked like this:
Protected WithEvents lstcat As Swap.NET.categorylist

Where Swap.NET is the name of my project within my solution. Now, I can only
declare the control as:
Protected WithEvents lstcat As categorylist

When I try to declare it as in the first example, I get an error, "Type
swap.net.categorypicklist" not defined.

What did I do, and how do I fix it?

BV.
 
R

Rick Spiewak

Take a look at the properties of your project (right-click in solution
explorer on the project.) Check the namespace. By default, it is the same as
the project name. You may have changed it, or added "Namespace" directives
in your code.

And, remember, even if you use VB.NET, namespaces are case sensitive.
 
B

Benign Vanilla

Rick Spiewak said:
Take a look at the properties of your project (right-click in solution
explorer on the project.) Check the namespace. By default, it is the same as
the project name. You may have changed it, or added "Namespace" directives
in your code.

And, remember, even if you use VB.NET, namespaces are case sensitive.
<snip>

Rick, thanks. That was not the problem, but your post has led me to the
cause. I had renamed this page to swap, and someone that was causing
problems. When I renamed the page, and as a result the class within, to a
new name, everything started working again.

BV.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top