473,327 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Protected WithEvents Question

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.
Nov 18 '05 #1
2 1997
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.

"Benign Vanilla" <BV******@tibetanbeefgarden.com> wrote in message
news:2j*************@uni-berlin.de...
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.

Nov 18 '05 #2

"Rick Spiewak" <ri*********@mindspring.com> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
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.
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jakob Bengtsson | last post by:
Hi, I have a form (which cannot be serialized). In the form's code I declare an object like this (never mind the object nor class name, it's for illustration only): Private WithEvents...
2
by: Peter | last post by:
Hello, Thanks for reviewing my question. I am following KB article about creating a custom control and its source code is in VB. I got to a part where I have the following: Private...
11
by: Brett | last post by:
What is the C# equivalent for this VB.NET code: Private WithEvents IE_Inst As New SHDocVw.InternetExplorer I get as far as: private SHDocVw.InternetExplorer IE_Inst = new...
2
by: Andreas Klemt | last post by:
Hello, what is the difference between a) Protected WithEvents myClassName b) Protected myClassName Thanks, Andreas
4
by: Brian Lowe | last post by:
I have several aspx pages that include a couple of asp:placeholder controls, an example is myPage.aspx. The page inherits from a custom class 'myClass' which inherits System.Web.UI.Page which...
0
by: hansiman | last post by:
I sometimes see references to controls that has been removed from the aspx page in the code behind. The references linger in the region "Web Form Designer Generated Code" and look like Protected...
7
by: Mike Voissem | last post by:
Every time I change a web user control(place a new object on it, or just change an objects properties), all of my Public WithEvents change to Protected WithEvents. Anyone have an idea of why this...
8
by: Bob Day | last post by:
Using VS 2003, VB.NET, MSDE If an event is raised in a class that was NOT instantiated with the WithEvents key word, is that event effectively ignored? Or, another way to phrase the question,...
2
by: Ron Dahl | last post by:
I'm very confused on how the Protected Overrides works. I created a new project with a new form1 and a new datagrid called myDataGrid. I created a simple DataTable and put 5 rows and 5 columns of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.