Asp.Net ListView 內的InsertItemTemplate 標籤修改
1: <InsertItemTemplate>
2: <tr style="">
3: <td>
4: <asp:DropDownList ID="ddl_depup" runat="server"
5: DataSourceID="dep_up_list"
6: DataTextField="sys_dep_name"
7: DataValueField="sys_dep_id"
8: SelectedValue='<%# Bind("sys_dep_up") %>'/>
9: </td>
10: </InsertItemTemplate>
C#後台語法 , 指定插入時動作
1: protected void ListView1_ItemInserting(object sender, ListViewInsertEventArgs e)
2: {
3: DropDownList ddl_depup = (DropDownList)ListView1.InsertItem.FindControl("ddl_depup");
4: e.Values["EmployeeID"] = ddl_depup.SelectedValue;
5: }
文章標籤
全站熱搜
留言列表