473,473 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting Error while using asp.net 2 and visual web developer 2005

The below is error message :
The type 'page2' already contains a definition for 'txtLocationName'

i know why this comes. but iam not ablke to find the other place where the
definition is added. coz iam not able to get this textbox object in the
intellisence sp i tried to add a line "protected TextBox txtLocationName =
new TextBox();" .. so i got this error. Plz help me on this

thanks in advance
--
Deepson Thomas
Nov 19 '05 #1
3 1022
In ASP.NET 2.0 when using codebehind ASP.NET generates a partial class to
go along with your codebehind. This partial is where all your server side
controls get declared for your codebehind. Without seeing your code, my guess
is that in your codebehind (the one your working in, not the ASP.NET generated
one) you've got the field declared. Just remove that line and you should
be all set.

As for the intellisense, it will eventually show up -- VS.NET will just need
some time to catch up. Try to write the code anyway, and I'm sure it'll work.
Just because it's not in intellisense doesn't mean it's not correct :)

-Brock
DevelopMentor
http://staff.develop.com/ballen
The below is error message :
The type 'page2' already contains a definition for 'txtLocationName'
i know why this comes. but iam not ablke to find the other place where
the definition is added. coz iam not able to get this textbox object
in the intellisence sp i tried to add a line "protected TextBox
txtLocationName = new TextBox();" .. so i got this error. Plz help me
on this

thanks in advance


Nov 19 '05 #2
Ya u r right. i wrote the code and it worked. i deleted that line and itz
okay ... can u tell me where can i find that code where all the controls are
declared ... this is for my information. anyways thank u very much for ur
prompt reply ...
--
Deepson Thomas
"Brock Allen" wrote:
In ASP.NET 2.0 when using codebehind ASP.NET generates a partial class to
go along with your codebehind. This partial is where all your server side
controls get declared for your codebehind. Without seeing your code, my guess
is that in your codebehind (the one your working in, not the ASP.NET generated
one) you've got the field declared. Just remove that line and you should
be all set.

As for the intellisense, it will eventually show up -- VS.NET will just need
some time to catch up. Try to write the code anyway, and I'm sure it'll work.
Just because it's not in intellisense doesn't mean it's not correct :)

-Brock
DevelopMentor
http://staff.develop.com/ballen
The below is error message :
The type 'page2' already contains a definition for 'txtLocationName'
i know why this comes. but iam not ablke to find the other place where
the definition is added. coz iam not able to get this textbox object
in the intellisence sp i tried to add a line "protected TextBox
txtLocationName = new TextBox();" .. so i got this error. Plz help me
on this

thanks in advance


Nov 19 '05 #3
The best way to see the generated code is to mark your code with debug=true
then go to the ~/windows/Microsoft.net/Framework/v2.0.x.y/Temp ASP.NETFiles/YourAppName/foo/bar/*.cs

Essentially, they're under there with dynamically generated path names once
you compile with debug=true.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Ya u r right. i wrote the code and it worked. i deleted that line and
itz okay ... can u tell me where can i find that code where all the
controls are declared ... this is for my information. anyways thank u
very much for ur prompt reply ...

"Brock Allen" wrote:
In ASP.NET 2.0 when using codebehind ASP.NET generates a partial
class to go along with your codebehind. This partial is where all
your server side controls get declared for your codebehind. Without
seeing your code, my guess is that in your codebehind (the one your
working in, not the ASP.NET generated one) you've got the field
declared. Just remove that line and you should be all set.

As for the intellisense, it will eventually show up -- VS.NET will
just need some time to catch up. Try to write the code anyway, and
I'm sure it'll work. Just because it's not in intellisense doesn't
mean it's not correct :)

-Brock
DevelopMentor
http://staff.develop.com/ballen
The below is error message :
The type 'page2' already contains a definition for 'txtLocationName'
i know why this comes. but iam not ablke to find the other place
where
the definition is added. coz iam not able to get this textbox object
in the intellisence sp i tried to add a line "protected TextBox
txtLocationName = new TextBox();" .. so i got this error. Plz help
me
on this
thanks in advance


Nov 19 '05 #4

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

Similar topics

27
by: Richard Blewett [DevelopMentor] | last post by:
I've just seen on Eric Gunnerson's blog that C# is getting Edit and Continue in Whidbey. That will please alot of people - although me, I have mixed feelings about it ;-) ...
5
by: Kevin R | last post by:
I'm trying to update a sql database. It's modified Oledb code from an example that did work with an access database. How can I tweak my code to make it work? Thanks in advance. Kevin...
0
by: ME | last post by:
I can't seem to delete records using an objectdatasource. The object is a Typed Collection built by Visual Studio that access a SQL Database. When I try to delete using the ObjectDataSource it...
3
by: Ted | last post by:
In WSAT, I get the following error when trying to set up my provider: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site...
2
by: Manikandan | last post by:
Hi, I have a program written in .Net Framework 1.1 using Visual studio enterprise edition 2003. I tried compiling the same program in visual c# express edition 2005. I'm getting following...
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...
0
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,...
0
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...
1
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
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...
0
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 ...

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.