OK. I have 2 different scenario.
Scenario 1.
I have a formview that I use to insert records. It adds the records to
mailbox table (Access or SQL). So I have the formview bound to either
AccessDataSource or SQLDataSource controls.
I also have a table (mailboxdefault) that has default values for some of the
mailbox fields. These can be changed by the system administrator.
What I am trying to do is the following:
When the formview control is displayed in insert mode, I want the fields to
display the values from the mailboxdefault, allowing the user to change them
if desired or leave the defaults as is, and then add the record to the
mailbox table.
Can I bind the textbox control in the inserttemplate to a different data
source than the one use to bind the formview?
Scenario 2.
Can I bind a regular textbox control (not in a formview or gridview, etc) to
a datasource so I can display a value from a table?
Thanks to everyone for your help.
--
Thanks
Morris
"Steven Cheng[MSFT]" wrote:
> Hi Morris,
>
> For TextBox control, it is a simple databound webcontrol, you can simply
> bind its property with an object/value or function e.g.
>
> <asp:TextBox .... Text=<%# function or object %> />
>
> For DataSource control, it is designed to support template based databound
> control or list databound control rather, so those simple controls like
> Label , Textbox doesn't directly support binding with it.
>
> Would you provide some further information about the scenario in your page?
> So far according to your description, I think it may be better that we use
> code to programmatically retrieve value and assign it to textbox(if it is
> already in a template control which bound to another datasource).
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
|