In VS.NET can you disable auto-code-behind?

I

Ian

When you add a control to the web form designer in VS.NET, say a label
called "InheritanceTestLabel", VS.NET automatically adds the following
line to the code-behind.

protected new System.Web.UI.WebControls.Label InheritanceTestLabel;

I would like to inherit the code-behind from a class that already has
this protected member field. If you leave the line in the inherited
code-behind VS.NET complains that you need the new keyword cause
you're hiding the base class field.

Is there a way to disable this auto-code-behind behavior? Or ideally
for it to be smart enough to only add controls if they're not present
in the base class? If theres not a way to get rid of it, is there a
way to conditionally compile around it or something?

Ian
 

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