📄 groupsdlist.aspx
字号:
<%@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
'Now execute stored procedure
response.write("Execute some procedure @name=" + code_display + "@type=" + type)
End Sub
</script>
<body style="font: 10pt verdana">
<form runat="server">
<h3><font face="Verdana">Groups (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="Edit" 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="Update" CommandName="update" />
<asp:LinkButton id="button3" runat="server" Text="Cancel" CommandName="cancel" />
</EditItemTemplate>
</asp:DataList>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -