CS0102 Error on moving declaration to code-behind

csharp South Africa
  • 12 years ago

    Hi

    Any assistance on this one, driving me crackers (%->)

    If I move a declaration of a TreeView from the designer.cs file to the code-behind file and change the scope from protected to public, the compiler has no problem.

    But, at run-time (when I access the page) I get an exception saying that the variable has been re-declared!

    It seems that the auto-generated desginer.cs file is being re-created and then their is a variable conflict 'cos I have moved the declaration.

    Thanks

    Andy

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill