work, although it works outside of the InserItemTemplate.What is worng?" />
开发者

ListView InsertItemTemplate Does not work

开发者 https://www.devze.com 2023-03-31 05:51 出处:网络
I can\'t get <%# Eval(\"ID\") %> work, although it works outside of the InserItemTemplate.What is worng?

I can't get <%# Eval("ID") %> work, although it works outside of the InserItemTemplate. What is worng?

<InsertItemTemplate>
        <tr style="">
            <td>
                <asp:Button ID="btnInsert" runat="server" CommandName="InsertPhone" CommandArgument='<%# Eval("ID") %>' Text="InsertPhone" />

            </td>             
            <td style="width:50px">
                  <asp:DropDownList runat="server" ID="ddlPhoneType" DataSourceID='ObjectDataSourcePhoneTypes'
                    DataTextField="Name_ar" DataValueField="ID" />

            </td>
            <td style="width:100px">
                <asp:TextBox ID="PhoneNumberLabel" runat="server" Text='' />
            </td>
        </tr>
    </I开发者_JAVA百科nsertItemTemplate>

Thanks


Insert template isn't data bound so you can't use Eval there... Eval works in the context of a data bound row, but insert row is not data bound, so there's no data source for it. Programmably set the value in the field if you need to establish some value for a control.

0

精彩评论

暂无评论...
验证码 换一张
取 消