473,378 Members | 1,384 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,378 software developers and data experts.

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 2318
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.comwrote in message news:O1**************@TK2MSFTNGP04.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
'CtrlSqlErrorDisplay1' 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 "CtrlSqlErrorDisplay1" or "this.CtrlSqlErrorDisplay1" - the former gives
me CS0103 the latter gives "'pgCodeTableCarrier' does not contain a
definition for 'CtrlSqlErrorDisplay1'". 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
pgCodeTableCarrier 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.comwrote in message news:O1**************@TK2MSFTNGP04.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
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 << "\"\"...
3
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...
12
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...
1
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,...
6
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...
0
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...
28
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...
3
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...
5
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...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.