Update to VS2005

Discussion in 'ASP .Net' started by WO70, Nov 3, 2005.

  1. WO70

    WO70 Guest

    Hi NG,

    I converted a VS2003 ASP.NET solution to ASP.NET 2 and got 2 Errors
    like this:
    ERROR: The member declaration for 'reqValEdit' was removed and its
    accessibility has been changed from 'public' to 'protected'. To access
    this member from another page you should create a public accessor
    property for it. editor\FrageEdit.aspx.cs

    I read something about the new code behind model, but I was wondering
    if there is no way to change the access modifier of a WebControl.
    Should I do it like (below) this now, to access a WebControl from
    another Page?

    - Add a TextBox with ID _TextBox1 in Designer View.
    - In Codebehind add a Property like this:
    public System.Web.UI.WebControls.TextBox TextBox1
    {
    get
    {
    return _TextBox1;
    }
    }

    thx in advance
    Bjoern
    WO70, Nov 3, 2005
    #1
    1. Advertising

  2. Why not just go in and physically change it back from protected to public?




    --------------------------------------------------------------------------------

    All that glitters has a high refractive index.
    www.mendhak.com

    "WO70" <> wrote in message news:...
    Hi NG,

    I converted a VS2003 ASP.NET solution to ASP.NET 2 and got 2 Errors
    like this:
    ERROR: The member declaration for 'reqValEdit' was removed and its
    accessibility has been changed from 'public' to 'protected'. To access
    this member from another page you should create a public accessor
    property for it. editor\FrageEdit.aspx.cs

    I read something about the new code behind model, but I was wondering
    if there is no way to change the access modifier of a WebControl.
    Should I do it like (below) this now, to access a WebControl from
    another Page?

    - Add a TextBox with ID _TextBox1 in Designer View.
    - In Codebehind add a Property like this:
    public System.Web.UI.WebControls.TextBox TextBox1
    {
    get
    {
    return _TextBox1;
    }
    }

    thx in advance
    Bjoern
    S.M. Altaf [MVP], Nov 3, 2005
    #2
    1. Advertising

  3. WO70

    Bruce Barker Guest

    it a little more complicated than that.

    in 1.0/1.1 the aspx page inherited from the codebehind page. this meant if
    the control was defined in the codebehind, its defination was used.

    in 2.0 the code behind is a partial class (as is the aspx code). the
    controls variables are now defined in the aspx page only, so you cannot
    override them in the code behind.

    your solution is the correct one.

    -- bruce (sqlwork.com)



    "WO70" <> wrote in message
    news:...
    > Hi NG,
    >
    > I converted a VS2003 ASP.NET solution to ASP.NET 2 and got 2 Errors
    > like this:
    > ERROR: The member declaration for 'reqValEdit' was removed and its
    > accessibility has been changed from 'public' to 'protected'. To access
    > this member from another page you should create a public accessor
    > property for it. editor\FrageEdit.aspx.cs
    >
    > I read something about the new code behind model, but I was wondering
    > if there is no way to change the access modifier of a WebControl.
    > Should I do it like (below) this now, to access a WebControl from
    > another Page?
    >
    > - Add a TextBox with ID _TextBox1 in Designer View.
    > - In Codebehind add a Property like this:
    > public System.Web.UI.WebControls.TextBox TextBox1
    > {
    > get
    > {
    > return _TextBox1;
    > }
    > }
    >
    > thx in advance
    > Bjoern
    >
    Bruce Barker, Nov 4, 2005
    #3
  4. WO70

    WO70 Guest

    Hi,

    thank you. That's what I thought. But I wasn't sure ;-)

    by
    Bjoern
    WO70, Nov 4, 2005
    #4
    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. dbuchanan
    Replies:
    0
    Views:
    3,821
    dbuchanan
    Dec 28, 2005
  2. Hartmut Schroth
    Replies:
    3
    Views:
    3,489
    Hartmut Schroth
    Dec 1, 2003
  3. joun
    Replies:
    9
    Views:
    2,227
    W.G. Ryan eMVP
    Nov 30, 2004
  4. joun
    Replies:
    5
    Views:
    2,650
  5. =?Utf-8?B?TWljaGFlbA==?=

    How to update datagrid after update

    =?Utf-8?B?TWljaGFlbA==?=, Mar 17, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    495
    Alex D.
    Mar 17, 2006
Loading...

Share This Page