0
코드 숨김 아래에있는 내 코드 주어진 업데이트 바로 명령의 클릭에 DataList에 제어 항목 템플릿을 편집 항목 템플릿에서 수 바인딩 데이터 아닙니다.
protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)
{
DataTable dt = (DataTable)Session["time"];
string patient = ((TextBox)e.Item.FindControl("TbxPatient")).Text;
((Label)e.Item.FindControl("LblPatient")).Text = patient;
DataList1.EditItemIndex = -1;
DataList1.DataSource = dt;
DataList1.DataBind();
}
ASPX 마크 업
<asp:DataList ID="DataList1" runat="server" Caption="Doctor1" OnEditCommand="DataList1_EditCommand"
BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
CellPadding="3" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" ForeColor="Purple" GridLines="Vertical" OnCancelCommand="DataList1_CancelCommand"
OnItemDataBound="DataList1_ItemDataBound" OnSelectedIndexChanged="DataList1_SelectedIndexChanged"
OnUpdateCommand="DataList1_UpdateCommand">
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<AlternatingItemStyle BackColor="#DCDCDC" />
<ItemStyle BackColor="#EEEEEE" ForeColor="Black" />
<EditItemTemplate>
<table style="width: 100%;">
<tr>
<td>
Reg No
</td>
<td>
<asp:TextBox ID="TbxRegNo" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Patient
</td>
<td>
<asp:TextBox ID="TbxPatient" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Compliats
</td>
<td>
<asp:TextBox ID="TbxCompliant" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Mob.No
</td>
<td>
<asp:TextBox ID="TbxNo" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td colspan="2">
<asp:LinkButton ID="button2" runat="server" CommandName="update" OnClick="button2_Click"
Text="Update" />
<asp:LinkButton ID="button3" runat="server" CommandName="Cancel" Text="Cancel" />
</td>
<td>
</td>
</tr>
</table>
</EditItemTemplate>
<SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<ItemTemplate>
<br />
<table style="width: 100%;">
<tr>
<td colspan="3">
<asp:Label ID="Label3" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"time") %>'></asp:Label>
</td>
</tr>
<tr>
<td colspan="3">
<asp:Label ID="LblPatient" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:LinkButton ID="LinkButton3" runat="server" CommandName="select">Select</asp:LinkButton>
<asp:LinkButton ID="button3" runat="server" CommandName="edit" Text="Edit" />
</td>
<td>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
내가 이렇게 실례합니다 내가 도움 working.Please되지 않는 항목 template.above 코드에 대한 환자의 가치를 얻을 수없는 이유는 무엇입니까?