ListView::InsertItemTemplate / ObjectDataSource

Discussion in 'ASP .Net' started by Lubomir, Feb 14, 2010.

  1. Lubomir

    Lubomir Guest

    Hi, I have a ListView control and <InserItemTemplate> template.

    <InsertItemTemplate>
    <asp:Table runat =…..>
    <asp:TableRow runat …>
    <asp:TextBox ID=â€someTextBox†text=’<%# Bind(“AAAâ€) %> runat =
    …/>
    </asp:TableRow>
    </asp:Table>
    </InsertItemTemplate>

    The ObjectDataSource is bound to the ListView:
    <asp:ObjectDataSource ID=â€mydatasource†runat…>
    <InsertParameters>
    <asp:ControlParameter Name=â€ctrlPrm†ControlId=†someTextBoxâ€
    PropertyName=â€Text†… />
    </InsertParameters>
    </asp:ObjectDataSource>


    When I run the code and try to execute Insert command, I get exception, that
    the control “someTextBox†could not be found.

    On the net I found opinions that ObjectDataSource can not find the control
    because it has a different ID during the runtime. However, this renders
    ObjectDataSource to be not very usefull.

    How should I pass the parameter “ctrlPrm†to the ObjectDataSource (Insert
    command) ?
    I know there has been made some changes in the ListViewControl in .NET 4.
    Will be this behaviour changed?

    Thanks,
    Lubomir
     
    Lubomir, Feb 14, 2010
    #1
    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. pjbates
    Replies:
    1
    Views:
    4,537
    Dan Vogt
    May 2, 2006
  2. Swetha
    Replies:
    0
    Views:
    3,703
    Swetha
    Nov 14, 2005
  3. Satheesh
    Replies:
    0
    Views:
    2,490
    Satheesh
    Sep 17, 2008
  4. Lubomir

    ObjectDatasource - Cancel, ListView

    Lubomir, Feb 2, 2010, in forum: ASP .Net
    Replies:
    0
    Views:
    545
    Lubomir
    Feb 2, 2010
  5. .
    Replies:
    0
    Views:
    734
Loading...

Share This Page