Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > pass data from dataset to usercontrol

Reply
Thread Tools

pass data from dataset to usercontrol

 
 
Sandeman
Guest
Posts: n/a
 
      03-06-2004
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






 
Reply With Quote
 
 
 
 
Alessandro Zifiglio
Guest
Posts: n/a
 
      03-07-2004
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" <(E-Mail Removed)> wrote in message
news:%23F%23x$(E-Mail Removed)...
> 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
>
>
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a property of a control inside a usercontrol, from another usercontrol Fabiano ASP .Net 2 06-03-2005 09:56 AM
accessing usercontrol from another usercontrol Phl ASP .Net 2 11-18-2004 07:33 PM
Access a control inside an usercontrol from another control inside another usercontrol nail ASP .Net 0 09-15-2004 03:55 PM
Can we use a usercontrol inside a usercontrol Rajesh Tiwari ASP .Net 0 08-12-2003 03:56 PM
Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack huobazi ASP .Net 1 07-03-2003 03:14 AM



Advertisments