ListView::InsertItemTemplate / ObjectDataSource

L

Lubomir

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top