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

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

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

Share This Page