pass data from dataset to usercontrol

Discussion in 'ASP .Net Building Controls' started by Sandeman, Mar 6, 2004.

  1. Sandeman

    Sandeman Guest

    I have a usercontrol with some textboxes in it. The usercontrol is called
    Personal and the first textbox in it txtName.

    After the click button event i call some data and fill in in a dataset
    DSAccounts.

    Personal.txtName.Text= DSAccounts.Tables("Accounts").Rows(0).Item("Name")

    When i do it this way i get the ''ASP.Personal_ascx.txtName' is not
    accessible in this context because it is 'Protected'.

    What do i do wrong? And does anyone have a solution?

    Thanks in advance
    Sandeman, Mar 6, 2004
    #1
    1. Advertising

  2. hi Sandeman, can you provide some more details and code sample.
    Specificially i want to know if you are loading the usercontrol dynamically
    or if you added this at designtime. I want to see how you declared your
    usercontrol in your codebehing to access its properties etc.
    "Sandeman" <> wrote in message
    news:%23F%23x$...
    > I have a usercontrol with some textboxes in it. The usercontrol is called
    > Personal and the first textbox in it txtName.
    >
    > After the click button event i call some data and fill in in a dataset
    > DSAccounts.
    >
    > Personal.txtName.Text= DSAccounts.Tables("Accounts").Rows(0).Item("Name")
    >
    > When i do it this way i get the ''ASP.Personal_ascx.txtName' is not
    > accessible in this context because it is 'Protected'.
    >
    > What do i do wrong? And does anyone have a solution?
    >
    > Thanks in advance
    >
    >
    >
    >
    >
    >
    Alessandro Zifiglio, Mar 7, 2004
    #2
    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. huobazi
    Replies:
    1
    Views:
    667
    David Waz...
    Jul 3, 2003
  2. Rajesh Tiwari

    Can we use a usercontrol inside a usercontrol

    Rajesh Tiwari, Aug 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    399
    Rajesh Tiwari
    Aug 12, 2003
  3. nail
    Replies:
    0
    Views:
    1,528
  4. Phl
    Replies:
    2
    Views:
    510
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=
    Nov 18, 2004
  5. Fabiano
    Replies:
    2
    Views:
    580
    =?Utf-8?B?c3Jpbmk=?=
    Jun 3, 2005
Loading...

Share This Page