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

G

Guest

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
 
B

Brock Allen

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 :)
 
G

Guest

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 ...
 
B

Brock Allen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top