看起來這應該是直截了當的,但我很驚訝。我有我的列表查看所有設置並綁定到我的LINQ數據源。源依賴於下拉列表,該列表決定哪個分支信息在列表視圖中顯示。我的編輯模板工作正常,但我的插入模板將無法正常工作,因爲它想要從列表視圖外的下拉列表中獲取分支ID,但我不知道如何綁定該值並將其設置在我的模板中。它看起來像這樣:帶有LINQ數據源插入模板的ListView
<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert"
Text="Insert" />
</td>
<td>
<asp:TextBox ID="RechargeRateTextBox" runat="server"
Text='<%# Bind("RechargeRate") %>' />
</td>
<td>
<asp:Calendar SelectedDate='<%# Bind("StartDate") %>' ID="Calendar1" runat="server"></asp:Calendar>
</td>
</tr>
</InsertItemTemplate>
我需要得到一個標籤那裏,結合數據綁定的ASP下拉列表的值列表視圖之外,使得插入會工作。