473,661 Members | 2,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CS0103 - strange errors

I get following errors under C#
The name 'txtName' does not exist in the current context
The name 'txtName' does not exist in the current context

This is a nightmare. I have my web user control and I
dragged it into DIV on my .aspx page. It's just a panel with a few textboxes.
When I try to access some textbox, the above errors show up.
What is the remedy - I want to reuse this control on different pages.
Using VB.NET all works fine but I have to use C#.
I beg for help.

Eric
Jul 26 '06 #1
3 2327
The most obvious difference between VB and C# when it comes to
identifying names is that C# is case sensetive, while VB is not.

Is the id of the control really "txtName", not some other case variation
like "txtname" or "TxtName"?

Eric wrote:
I get following errors under C#
The name 'txtName' does not exist in the current context
The name 'txtName' does not exist in the current context

This is a nightmare. I have my web user control and I
dragged it into DIV on my .aspx page. It's just a panel with a few
textboxes.
When I try to access some textbox, the above errors show up.
What is the remedy - I want to reuse this control on different pages.
Using VB.NET all works fine but I have to use C#.
I beg for help.

Eric
Jul 26 '06 #2

"Göran Andersson" <gu***@guffa.co mwrote in message news:O1******** ******@TK2MSFTN GP04.phx.gbl...
The most obvious difference between VB and C# when it comes to identifying names is that C# is case sensetive, while VB is not.

Is the id of the control really "txtName", not some other case variation like "txtname" or "TxtName"?

No. I checked and it's exactly the name that pops out after dot automaticaly.
FindControl() finds the "textName" but WHY on earth it doesn't allow
a simple access?? I created a new user control and the same thing happened.
Please help.

Eric

Jul 26 '06 #3
I have this same thing happening, but it happens in some files and not
others. I'm using Win2K (fully patched), .NET 2.0, and VS.NET 2005.

I have a series of files to maintain code table pages. All of them are
clones of a basic template (no comments on architecture, please). Most of
them are fine, one is not. When I do a Build Page, it's fine, but whenever I
Build or Rebuild the site or solution I get CS0103 errors ("The name
'CtrlSqlErrorDi splay1' does not exist in the curent contect.") in the .cs
file where I'm referencing the control on the aspx page. If I copy the files
to the site the problematic page runs fine, so I guess this is more ticking
me off than causing a problem (but it's *really* ticking me off).

Yes, everything is spelled correctly. Yes, case is correct. If I type
"this.Ctrl" the auto-fill pulls up the correct name. It doesn't matter if I
use "CtrlSqlErrorDi splay1" or "this.CtrlSqlEr rorDisplay1" - the former gives
me CS0103 the latter gives "'pgCodeTableCa rrier' does not contain a
definition for 'CtrlSqlErrorDi splay1'". I have deleted and recreated the
file - same problem. When I rename the files (and the underlying class) the
problem goes away. Is this beast caching something somewhere that it refuses
to get rid or? Is there something magic about a class called
pgCodeTableCarr ier as opposed to pgCodeTableFoo? What does Build Site do
that Build Page doesn't on a page-level?

thx
jeff

"Eric" wrote:
>
"Göran Andersson" <gu***@guffa.co mwrote in message news:O1******** ******@TK2MSFTN GP04.phx.gbl...
The most obvious difference between VB and C# when it comes to identifying names is that C# is case sensetive, while VB is not.

Is the id of the control really "txtName", not some other case variation like "txtname" or "TxtName"?


No. I checked and it's exactly the name that pops out after dot automaticaly.
FindControl() finds the "textName" but WHY on earth it doesn't allow
a simple access?? I created a new user control and the same thing happened.
Please help.

Eric

Aug 18 '06 #4

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

Similar topics

6
3015
by: Eric Boutin | last post by:
Hi ! I have a strange problem with a std::ostringstream.. code : #include <sstream> /*...*/ std::ostringstream ss(); ss << "\"\"" << libpath << "\"\" \"\"" << argfilename << "\"\" \"\"" << outfilename << "\"\""; //line 75
3
1667
by: Jason | last post by:
I have two applications that I wrote that use asp and javascript source files. Recently both of these applications starting acting strange on my test box. Image icons will randomly stop showing up and any javascript that I use a src file with <script language="javascript" src="mytest.js"></script> ) returns random errors. Javascript on the page itself works fine. If I click f5 multiple times I will get different results. I am...
12
1501
by: ishtar2020 | last post by:
Hi everybody I've been writing my very first application in Python and everything is running smoothly, except for a strange problem that pops up every once in a while. I'm sure is the kind of newbie thing every seasoned programmer knows. Sometimes a receive strange Syntax Errors from parts of code that worked perfectly minutes ago. What's even more puzzling is that those errors are pointed to another part of the module when I do some...
1
2438
by: Larax | last post by:
Alright, so here's the problem. I define a global variable in my script and then add methods/properties to it. Everything works great, no error in Javascript Console. But when I refresh site, several errors "variable is not defined" are displayed. What is more strange, the script is still working ! After each another refresh these errors are keep showing, only after I close site and open it again, these errors disappear, but only to next...
6
2357
by: robert | last post by:
I get python crashes and (in better cases) strange Python exceptions when (in most cases) importing and using cookielib lazy on demand in a thread. It is mainly with cookielib, but remember the problem also with other imports (e.g. urllib2 etc.). And again very often in all these cases where I get weired Python exceptions, the problem is around re-functions - usually during re.compile calls during import (see some of the exceptions below). But...
0
1048
by: AndreasJ.Mueller | last post by:
Hi Since we have moved our application (.NET 1.1) to a new server a few weeks ago we have seen in the event-logs multiple errors (which in itself is not my current problem, so I no Server.Transfer-Comments). What seems very strange is that each corresponding request shows as user agent "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4" even though the requests come from different IPs from all...
28
2078
by: charlie | last post by:
Hi, I found an article on informit.com that talks about C++ casts http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=285&rl=1 The strange thing is the author says the following code will *not* compile: double d=15.95; int n= static_cast<int(d);
3
1716
by: gdubois | last post by:
Hi!! I am trying for the first time to put on our intranet a really basic ASP.NET page, using VS2003 and C#. It's a page reading some info from an ACCESS database, using one dataset (dsSchedule) and a datagrid. Locally on my machine everything works fine. I copied directly all the files directy in my Virtual Folder on the server.
5
2428
by: ioni | last post by:
Good day, fellows! I have a strange problem – at my site there is a flash strip, that loads data dynamically. It works fine (grabs data from the remote server and presents it), however in IE7 and its clones I encounter a strange problem where I can hear clicking sound non-stop (like the page is being reloaded non- stop), whereas the page is not reloading.
0
8343
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
8855
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
8758
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...
0
8633
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...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1743
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.