📄 addresslist.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddressList.aspx.cs" Inherits="AddressList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body leftmargin=0 rightmargin=0>
<form id="form1" runat="server">
<div>
<TABLE style="FONT-SIZE: 12px; FONT-FAMILY: Tahoma; BORDER-COLLAPSE: collapse"
cellSpacing="0" cellPadding="2" align="center" border="0">
<tr>
<td colspan=2 align="center">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/AddressAdd.aspx" Target="_self">添加好友</asp:HyperLink>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/ModifyPwd.aspx" Width="49px">修改密码</asp:HyperLink></td>
</tr>
<tr><td>
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" Visible="False" />
<asp:BoundField DataField="userId" HeaderText="userId" SortExpression="userId" Visible="False" />
<asp:BoundField DataField="frdName" HeaderText="姓名" SortExpression="frdName" />
<asp:BoundField DataField="frdPhone" HeaderText="电话" SortExpression="frdPhone" />
<asp:BoundField DataField="frdMobilePhone" HeaderText="手机" SortExpression="frdMobilePhone" />
<asp:BoundField DataField="frdAddress" HeaderText="地址" SortExpression="frdAddress" Visible="False" />
<asp:BoundField DataField="frdQQ" HeaderText="QQ" SortExpression="frdQQ" />
<asp:BoundField DataField="frdEmail" HeaderText="E_Mail" SortExpression="frdEmail" />
</Columns>
<EditRowStyle Width="10px" />
</asp:GridView>
</td>
</tr>
<tr>
<td >
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="4"
DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None" Height="50px"
Width="247px">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
<EditRowStyle BackColor="#999999" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<Fields>
<asp:BoundField DataField="frdName" HeaderText="姓名:" SortExpression="frdName">
<ControlStyle Font-Names="隶书" />
<ItemStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
<HeaderStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="frdPhone" HeaderText="电话:" SortExpression="frdPhone">
<ItemStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
<HeaderStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="frdMobilePhone" HeaderText="手机:" SortExpression="frdMobilePhone" >
<ItemStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
<HeaderStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="frdAddress" HeaderText="地址:" SortExpression="frdAddress" >
<ItemStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
<HeaderStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="frdQQ" HeaderText="QQ:" SortExpression="frdQQ" >
<ItemStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
<HeaderStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
</asp:BoundField>
<asp:BoundField DataField="frdEmail" HeaderText="E_Mail:" SortExpression="frdEmail" >
<ItemStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
<HeaderStyle Font-Names="楷体_GB2312" Font-Size="12pt" Wrap="False" />
</asp:BoundField>
</Fields>
<FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [AddressLists] WHERE [id] = @original_id"
InsertCommand="INSERT INTO [AddressLists] ([userId], [frdName], [frdPhone], [frdMobilePhone], [frdAddress], [frdQQ], [frdEmail]) VALUES (@userId, @frdName, @frdPhone, @frdMobilePhone, @frdAddress, @frdQQ, @frdEmMail)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [AddressLists] WHERE ([userId] = @userId)"
UpdateCommand="UPDATE [AddressLists] SET [frdName] = @frdName, [frdPhone] = @frdPhone, [frdMobilePhone] = @frdMobilePhone, [frdAddress] = @frdAddress, [frdQQ] = @frdQQ, [frdEmail] = @frdEmail WHERE [id] = @original_id">
<DeleteParameters>
<asp:Parameter Name="original_id" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="frdName" Type="String" />
<asp:Parameter Name="frdPhone" Type="String" />
<asp:Parameter Name="frdMobilePhone" Type="String" />
<asp:Parameter Name="frdAddress" Type="String" />
<asp:Parameter Name="frdQQ" Type="String" />
<asp:Parameter Name="frdEmail" Type="String" />
<asp:Parameter Name="original_id" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="userId" Type="String" />
<asp:Parameter Name="frdName" Type="String" />
<asp:Parameter Name="frdPhone" Type="String" />
<asp:Parameter Name="frdMobilePhone" Type="String" />
<asp:Parameter Name="frdAddress" Type="String" />
<asp:Parameter Name="frdQQ" Type="String" />
<asp:Parameter Name="frdEmail" Type="String" />
</InsertParameters>
<SelectParameters>
<asp:SessionParameter Name="userId" SessionField="userID" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT frdName, frdPhone, frdMobilePhone, frdAddress, frdQQ, frdEmail FROM AddressLists WHERE (id = @id)">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="id" PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
</td></tr>
</TABLE>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -