Auto code generation overrides my control in base class

Discussion in 'ASP .Net' started by mirek, Feb 16, 2004.

  1. mirek

    mirek Guest

    Hi,
    I'm looking for a workaround on following problem: my page derives from
    base page class, this base class has a web control member and on every
    derived pages in html I put a tag with id of this control. But when I
    switch to design mode and save th page. The control is auto generated in
    the code behind classes, which overrides the declaration in the base page.
    How to solve it? TIA

    Regards,
    mirek
     
    mirek, Feb 16, 2004
    #1
    1. Advertisements

  2. mirek

    Yuri Belenky Guest

    It is well-known feature of VS.NET IDE. You should add your modification
    outside of region for auto-generated code.
    "mirek" <> wrote in message
    news:c0qcbu$12$...
    > Hi,
    > I'm looking for a workaround on following problem: my page derives from
    > base page class, this base class has a web control member and on every
    > derived pages in html I put a tag with id of this control. But when I
    > switch to design mode and save th page. The control is auto generated in
    > the code behind classes, which overrides the declaration in the base page.
    > How to solve it? TIA
    >
    > Regards,
    > mirek
     
    Yuri Belenky, Feb 16, 2004
    #2
    1. Advertisements

  3. mirek

    mirek Guest

    Yuri Belenky wrote:
    > It is well-known feature of VS.NET IDE. You should add your modification
    > outside of region for auto-generated code.


    Could you specify exactly where to put this code? I see only one
    auto-generated code region in my derived class and there are only
    methods InitializeComponent and OnInit methods. The member that is
    autogenerated is not in this region. Maybe in aspx files should I mark a
    fragment to not be autogenerated and this would make sense (if yes, what
    is the syntax to write it?).

    Regards,
    mirek
     
    mirek, Feb 16, 2004
    #3
    1. Advertisements

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. Replies:
    0
    Views:
    2,462
  2. Alf P. Steinbach
    Replies:
    6
    Views:
    823
    John Carson
    Sep 3, 2005
  3. lord trousers
    Replies:
    4
    Views:
    1,169
    James Kanze
    Jan 10, 2008
  4. Hicham Mouline
    Replies:
    1
    Views:
    840
    Victor Bazarov
    Apr 20, 2009
  5. lkcl
    Replies:
    6
    Views:
    527
  6. Reiner Max

    Thread: Control Overrides Page

    Reiner Max, Jul 29, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    128
    John Saunders
    Jul 30, 2004
  7. Marcos
    Replies:
    9
    Views:
    379
    Marcos
    Aug 17, 2009
  8. Karan Rajput
    Replies:
    2
    Views:
    312
    Abinoam Jr.
    Dec 22, 2010
Loading...