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

Discussion in 'ASP .Net' started by Ian, Oct 23, 2003.

  1. Ian

    Ian Guest

    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
     
    Ian, Oct 23, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    631
    Alphonse Giambrone
    Jun 28, 2003
  2. hb
    Replies:
    2
    Views:
    455
    Joe Fallon
    Jul 10, 2004
  3. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    522
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  4. linkswanted
    Replies:
    1
    Views:
    970
  5. Iluvatar
    Replies:
    3
    Views:
    3,292
    Iluvatar
    Jun 4, 2008
Loading...

Share This Page