Access Control in DataSource

Discussion in 'ASP .Net' started by myzm, Apr 28, 2006.

  1. myzm

    myzm Guest

    Hi,

    I have a FormView looks like this
    <asp:FormView>
    <ItemTemplate>
    <asp:Table>
    <asp:TableRow>
    <asp:TableCell>
    <asp:TextBox ID="textBox1">
    </asp:TableCell>
    </asp:TableRow>
    </asp:Table>
    </ItemTemplate>
    </asp:FormView>

    I want to reference the TextBox in DataSource parameters.

    <asp:ObjectDataSource UpdateMethod="UpdateDistrict">
    <UpdateParameters>
    <asp:ControlParameter Name="ID" ControlID="TextBox1"
    PropertyName="Text" />
    </UpdateParameters>
    </asp:ObjectDataSource>

    How can do it? Thanks.
    myzm, Apr 28, 2006
    #1
    1. Advertising

  2. If you put the DataSource control inside the the ItemTemplate the it will be
    able to "see" the TextBox. Otherwise i think you will have to set the
    parameter value from the DataSource programatically by using something like

    TextBox MyTextBox = (TextBox)BoxFormView.Findcontrol("TextBox1");
    Parameter=MyTextBox.Text;




    "myzm" wrote:

    > Hi,
    >
    > I have a FormView looks like this
    > <asp:FormView>
    > <ItemTemplate>
    > <asp:Table>
    > <asp:TableRow>
    > <asp:TableCell>
    > <asp:TextBox ID="textBox1">
    > </asp:TableCell>
    > </asp:TableRow>
    > </asp:Table>
    > </ItemTemplate>
    > </asp:FormView>
    >
    > I want to reference the TextBox in DataSource parameters.
    >
    > <asp:ObjectDataSource UpdateMethod="UpdateDistrict">
    > <UpdateParameters>
    > <asp:ControlParameter Name="ID" ControlID="TextBox1"
    > PropertyName="Text" />
    > </UpdateParameters>
    > </asp:ObjectDataSource>
    >
    > How can do it? Thanks.
    >
    >
    =?Utf-8?B?Y2xpY2tvbg==?=, Apr 28, 2006
    #2
    1. Advertising

  3. myzm

    myzm Guest

    Anyone has any idea about this problem? Thanks.
    myzm, May 1, 2006
    #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.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    584
    Guest
    Nov 10, 2003
  2. Replies:
    0
    Views:
    882
  3. =?Utf-8?B?S2VpdGggSGFycmlz?=

    Cannot access current datasource row for ds bound to datagrid

    =?Utf-8?B?S2VpdGggSGFycmlz?=, Nov 8, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    339
    =?Utf-8?B?S2VpdGggSGFycmlz?=
    Nov 8, 2004
  4. roni
    Replies:
    0
    Views:
    510
  5. xz
    Replies:
    9
    Views:
    526
    James Kanze
    Jan 8, 2008
Loading...

Share This Page