473,809 Members | 2,908 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Intellisense bug ?

GD
I have a situation where I have renamed a HTML Label from "Label1" to
"lblResult2 in an aspx page.
However when I write code in the code behind module the control name
"Label1" still appears in the intellisense list and I get the error
"System.NullRef erenceException : Object reference not set to an instance of
an object." when I try to access the properties of the lblResults control.

I've searched through MSDN for a solution/bugfix for this without any luck..

Anyone had this before ??

Thanks

Gary
Nov 18 '05 #1
5 1148
Make sure your .aspx side has the id="lblResults " and runat="server"

Then look at the field definitions inside you class.

you should see one that says

protected Label lblResults;

Let me know if that doesn't solve your problem.

bill
(it isn't an intellisense bug)

"GD" <No************ *************** **@eircom.net.N oSpam> wrote in message
news:Ox******** *****@TK2MSFTNG P10.phx.gbl...
I have a situation where I have renamed a HTML Label from "Label1" to
"lblResult2 in an aspx page.
However when I write code in the code behind module the control name
"Label1" still appears in the intellisense list and I get the error
"System.NullRef erenceException : Object reference not set to an instance of
an object." when I try to access the properties of the lblResults control.

I've searched through MSDN for a solution/bugfix for this without any luck..
Anyone had this before ??

Thanks

Gary

Nov 18 '05 #2
GD
In the definitions I have;

Protected Withevents lblResults As System.Web.UI.W ebControls.Labe l

This occurs directly after the empty "InitialiseComp onent" Sub and before
the line - Private designerplaceho lderDeclaration as System.Object

There were two other declarations there for controls that had been deleted
(manually from the HTML source)

The line causing the error is a debug line in the code-behind module -

Response.Write( "Label Value is - " & Me.lblResults.T ext)

If I remove that line, then the same error occurs on - Me.lblResults.T ext =
sResults.ToStri ng

Thanks for your help

Gary

"William F. Robertson, Jr." <wf*********@kp mg.com> wrote in message
news:e3******** *****@TK2MSFTNG P11.phx.gbl...
Make sure your .aspx side has the id="lblResults " and runat="server"

Then look at the field definitions inside you class.

you should see one that says

protected Label lblResults;

Let me know if that doesn't solve your problem.

bill
(it isn't an intellisense bug)

"GD" <No************ *************** **@eircom.net.N oSpam> wrote in message
news:Ox******** *****@TK2MSFTNG P10.phx.gbl...
I have a situation where I have renamed a HTML Label from "Label1" to
"lblResult2 in an aspx page.
However when I write code in the code behind module the control name
"Label1" still appears in the intellisense list and I get the error
"System.NullRef erenceException : Object reference not set to an instance of an object." when I try to access the properties of the lblResults control.
I've searched through MSDN for a solution/bugfix for this without any

luck..

Anyone had this before ??

Thanks

Gary


Nov 18 '05 #3

"GD" <No************ *************** **@eircom.net.N oSpam> wrote in message
news:%2******** *********@TK2MS FTNGP10.phx.gbl ...
In the definitions I have;

Protected Withevents lblResults As System.Web.UI.W ebControls.Labe l

This occurs directly after the empty "InitialiseComp onent" Sub and before
the line - Private designerplaceho lderDeclaration as System.Object

There were two other declarations there for controls that had been deleted
(manually from the HTML source)

The line causing the error is a debug line in the code-behind module -

Response.Write( "Label Value is - " & Me.lblResults.T ext)

If I remove that line, then the same error occurs on - Me.lblResults.T ext =
sResults.ToStri ng

Thanks for your help

Gary


Double-check the html for this label. Also, you said it was an html label, make
sure that it has runat="server" attribute associated with it as well. And double
check the id of the html label in the html portion.

Mythran
Nov 18 '05 #4
> I have a situation where I have renamed a HTML Label from "Label1" to
"lblResult2 in an aspx page.


Just a thought, but did you make the change in the HTML view or the
Design view? If you made the change in the HTML view, go to the Design
view. I've had to do this to get the Code-Behind to update the member
variable name properly...

hth

--

Scott Mitchell
mi******@4guysf romrolla.com
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla. com!
Nov 18 '05 #5
GD
Problem sorted ... thank you

"Scott Mitchell [MVP]" <mi******@4guys fromrolla.com> wrote in message
news:lG******** ********@newssv r27.news.prodig y.com...
I have a situation where I have renamed a HTML Label from "Label1" to
"lblResult2 in an aspx page.


Just a thought, but did you make the change in the HTML view or the
Design view? If you made the change in the HTML view, go to the Design
view. I've had to do this to get the Code-Behind to update the member
variable name properly...

hth

--

Scott Mitchell
mi******@4guysf romrolla.com
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla. com!

Nov 18 '05 #6

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

Similar topics

8
2407
by: andrew.queisser | last post by:
Yesterday I typed in some C++ code that called a function with two ints. Intellisense (auto-complete) helpfully told me that the first formal parameter was called "frontLight" and the second "ringLight". It occurred to me that I'm getting some semantic help here on top of the obvious type safety. It seems to me that the existance of this kind of support is tied to the static typing nature of C++. I've always been interested in the...
6
8103
by: Stefan Kronberg | last post by:
I'm working on a solution containing about 20 projects. Some of the projects contain class definitions that are used in other of the projects. Most of the time intellisense is working ok, i.e. if I work with objects declared from my own classes intellisense will show me all alternatives (methods and properties from my classes and from the classes they are derived from). But sometimes I will get nothing from intellisense, completely nothing,...
1
2215
by: Christopher W. Douglas | last post by:
I'm working in VB.Net, using Visual Studio 2003. I have a project, let's call it Foo, that contains common methods, forms, and objects I use in other projects. It compiles as Foo.dll, which I then reference from the project that needs it. Let's say I have a method, Bar, that I want to access from another project. If I add a public module Methods to Foo, and add a public method Bar to Methods, I can call it from my other project a...
0
1331
by: Jim | last post by:
I had a strange problem the other day when using Intellisense, and wondering if anyone has any experience with or advice on this... Just to give some quick background, I have a multi-tier application, with business objects coded in a business layer (C# project), the service interfaces and service objects coded in two C# projects, respectively. In my service objects project, I go to call on one of the
1
1898
by: Yaron | last post by:
Hi, I have a custom ListView-type control that I designed a few months ago. The control is completely stable and functional. However, often, the Visual Studio .NET IDE's Intellisense will lose and not display members not contained inside of Control (which my control is inherited from). Despite this, program execution still works fine; Intellisense just stops displaying these members, is all. If I close down Visual Studio and open it again,...
9
2683
by: Ulf Lindback | last post by:
Hi! We have an application surveillance product with a number of API's for different languages; one of them is a C API. Now I wonder how we can supply intellisense to our Visual Studio.Net (native C/C++) users (preferably both VS 7.0 and 7.1). I would like to have something like the parameter info you get for e.g. printf when you enter the opening parenthesis, printf(
3
1535
by: AJ | last post by:
I am using Microsoft Visual C++ .NET in Visual Studio 2003. Why there is no intellisense in MC++? Any workarounds?
12
4838
by: Peteroid | last post by:
I was creating my application just fine for the last 3 weeks or so. Then, starting this morning, IntelliSense seems to be having problems. It goes into a locked 'Updating IntelliSense..." mode. When this happens its time to close VS C++.NET, which can only be done via the Windows Task Manager. I tried repairing C++. It did seem to help, but the problem is back a few hours later. I will try creating a new project, copy over source files,...
5
3253
by: wal | last post by:
Hello, I'm using __declspec(property) to access get/set methods as properties (like in C# and VB.NET). Now, the problem is that both the property name and the get/set methods show in the intellisense list. Is there anyway to remove the names of the get/set methods from the intellisense list? Here's an example, I have two methods, one is a get method with the name getText and another set method with the name setText, the name of the...
3
340
by: Travis | last post by:
Hi, I was a user of Visual C# for a while and have gotten used to the Intellisense for that program. I went to try Visual Basic, and the intellisense is so much different. I'll try to make an example: Say I want to write: MessageBox.Show("Hi there") In C#, once I type just a single "M," everything (objects, classes, everything) that begins with M will appear in the intellisense list. Once you get to "Mes" MessageBox will be selected...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10633
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10375
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3860
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.