<%@Page Language="VB" Inherits="BaseClass" Src="GroupsDlist.vb" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<script language="VB" runat="server">
Sub DataList_UpdateCommand(sender As Object, e As DataListCommandEventArgs)
	dim sql as string
	Dim code_display  As String 
	Dim type As String 
	Dim myTextBox    As TextBox
	myTextBox = E.Item.FindControl("edit_display")
	code_display = mytextbox.text
	myTextBox = E.Item.FindControl("edit_type")
	type = mytextbox.text
	'执行存储过程
	response.write("执行存储过程 @name=" + code_display + "@type=" + type)
End Sub
</script>
<body style="font: 10pt verdana">
  <form runat="server">
    <h3><font face="Verdana">组(DataList) </font></h3>
    <asp:Label id="Message" runat="server"/>
    <asp:DataList id="Grid1" runat="server"
	BorderColor="black"
	BorderWidth="1"
	GridLines="Both"
	CellPadding="3"
	CellSpacing="0"
	Font-Name="Verdana"
	Font-Size="8pt"
	Width="800px"
	HeaderStyle-BackColor="#aaaadd"
	AlternatingItemStyle-BackColor="Gainsboro"
	EditItemStyle-BackColor="lightgreen"
	OnEditCommand="DataList_EditCommand"
	OnUpdateCommand="DataList_UpdateCommand"
	OnCancelCommand="DataList_CancelCommand"
	RepeatColumns="3" RepeatDirection="horizontal" RepeatMode="Table"   >
	<HeaderTemplate>Name</HeaderTemplate>
	 <ItemTemplate>
	     <asp:LinkButton id="button1" runat="server" Text="编辑" CommandName="edit" />
	     <%# Container.DataItem("code_display")  %>
  	</ItemTemplate>
	<EditItemTemplate>
	    Name:
	    <asp:Label id="Label1" runat="server" Text='<%# Container.DataItem("code_display")  %>' />
	    <br>
	    Group:
	    <asp:TextBox id="edit_display" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "code_display") %>' />
	    <br>
	    Type:
	    <asp:TextBox id="edit_type" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "type") %>' />
	    <br>
	    <asp:LinkButton id="button2" runat="server" Text="更新" CommandName="update" />
	    <asp:LinkButton id="button3" runat="server" Text="取消" CommandName="cancel" />
	 </EditItemTemplate>
	</asp:DataList>
     </form>
</body>
</html>
