代码如下.
<%@ Page Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true" CodeFile="Admin_Info.aspx.cs" Inherits="Admin_Admin_Info" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="width: 558px; position: relative">
<tr>
<td style="width: 100px; height: 21px">
<asp:HyperLink ID="HyperLink1" runat="server" Style="position: relative">添加管理员</asp:HyperLink></td>
<td style="width: 100px; height: 21px">
<asp:HyperLink ID="HyperLink2" runat="server" Style="position: relative">管理员信息</asp:HyperLink></td>
<td style="width: 100px; height: 21px">
</td>
<td style="width: 100px; height: 21px">
</td>
</tr>
</table>
<table style="left: 150px; width: 246px; position: relative; top: 2px">
<tr>
<td style="width: 100px">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT * FROM [AdminInfo] WHERE ([Admin_ID]=@Admin_ID)"
UpdateCommand="UPDATE AdminInfo SET Admin_name=@Admin_name,Admin_psw=@Admin_psw,Admin_realName=@Admin_realName,Admin_email=@Admin_email,Admin_addDate=@Admin_addDate WHERE (Admin_ID=@Admin_ID)" ConnectionString="<%$ ConnectionStrings:T_eshopConnectionString2 %>">
<UpdateParameters>
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_name" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_psw" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_realName" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_email" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_addDate" PropertyName="SelectedValue" />
<asp:QueryStringParameter Name="Admin_ID" QueryStringField="aid" />
</UpdateParameters>
<SelectParameters>
<asp:Parameter Name="Admin_ID" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
<table style="left: 201px; width: 197px; position: relative; top: 4px">
<tr>
<td style="width: 100px; color: #ff33ff; text-decoration: underline; text-align: center; display: block;">
管理员详细信息</td>
</tr>
</table>
<table style="width: 558px; position: relative">
<tr>
<td style="width: 100px; height: 18px;">
<asp:Label ID="lblMsg" runat="server" Style="position: relative" Text="lblMsg" Width="546px"></asp:Label></td>
</tr>
</table>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="SqlDataSource1"
Height="50px" OnItemUpdating="DetailsView1_ItemUpdating" Style="left: 7px; position: relative;
top: 4px; text-align: right;" Width="423px" OnItemUpdated="ItemUpdated" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" >
<Fields>
<asp:BoundField DataField="Admin_ID" HeaderText="管量员ID" ReadOnly="True" />
<asp:BoundField DataField="Admin_name" HeaderText="用户名" ReadOnly="True" />
<asp:BoundField DataField="Admin_psw" HeaderText="密码" />
<asp:BoundField DataField="Admin_realName" HeaderText="真实姓名" />
<asp:BoundField DataField="Admin_email" HeaderText="邮件地址" />
<asp:BoundField DataField="Admin_addDate" HeaderText="添加时间" />
<asp:CommandField ButtonType="Button" ShowEditButton="True" />
</Fields>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
</asp:DetailsView>
</asp:Content>
<%@ Page Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true" CodeFile="Admin_Info.aspx.cs" Inherits="Admin_Admin_Info" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="width: 558px; position: relative">
<tr>
<td style="width: 100px; height: 21px">
<asp:HyperLink ID="HyperLink1" runat="server" Style="position: relative">添加管理员</asp:HyperLink></td>
<td style="width: 100px; height: 21px">
<asp:HyperLink ID="HyperLink2" runat="server" Style="position: relative">管理员信息</asp:HyperLink></td>
<td style="width: 100px; height: 21px">
</td>
<td style="width: 100px; height: 21px">
</td>
</tr>
</table>
<table style="left: 150px; width: 246px; position: relative; top: 2px">
<tr>
<td style="width: 100px">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT * FROM [AdminInfo] WHERE ([Admin_ID]=@Admin_ID)"
UpdateCommand="UPDATE AdminInfo SET Admin_name=@Admin_name,Admin_psw=@Admin_psw,Admin_realName=@Admin_realName,Admin_email=@Admin_email,Admin_addDate=@Admin_addDate WHERE (Admin_ID=@Admin_ID)" ConnectionString="<%$ ConnectionStrings:T_eshopConnectionString2 %>">
<UpdateParameters>
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_name" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_psw" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_realName" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_email" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="DetailsView1" Name="Admin_addDate" PropertyName="SelectedValue" />
<asp:QueryStringParameter Name="Admin_ID" QueryStringField="aid" />
</UpdateParameters>
<SelectParameters>
<asp:Parameter Name="Admin_ID" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
<table style="left: 201px; width: 197px; position: relative; top: 4px">
<tr>
<td style="width: 100px; color: #ff33ff; text-decoration: underline; text-align: center; display: block;">
管理员详细信息</td>
</tr>
</table>
<table style="width: 558px; position: relative">
<tr>
<td style="width: 100px; height: 18px;">
<asp:Label ID="lblMsg" runat="server" Style="position: relative" Text="lblMsg" Width="546px"></asp:Label></td>
</tr>
</table>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="SqlDataSource1"
Height="50px" OnItemUpdating="DetailsView1_ItemUpdating" Style="left: 7px; position: relative;
top: 4px; text-align: right;" Width="423px" OnItemUpdated="ItemUpdated" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" >
<Fields>
<asp:BoundField DataField="Admin_ID" HeaderText="管量员ID" ReadOnly="True" />
<asp:BoundField DataField="Admin_name" HeaderText="用户名" ReadOnly="True" />
<asp:BoundField DataField="Admin_psw" HeaderText="密码" />
<asp:BoundField DataField="Admin_realName" HeaderText="真实姓名" />
<asp:BoundField DataField="Admin_email" HeaderText="邮件地址" />
<asp:BoundField DataField="Admin_addDate" HeaderText="添加时间" />
<asp:CommandField ButtonType="Button" ShowEditButton="True" />
</Fields>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
</asp:DetailsView>
</asp:Content>
解决方案 »
- DropDownList的值改变时事件问题?急!急!急!!
- excel远程导入报错
- 使用金格文本编辑(iWebOffice2009.cab#version=10,3,0,0) 如何将内容保存为word文档
- 初学css+div问题,float定位问题。
- 请高手挑战一下服务器table的另类用法
- DataGrid里嵌套Repeater,如何在Repeater的ItemDataBound中取到外面的DataGrid列中的值?
- 一个非常奇怪的问题!!!急
- 关于使用OLEDB连接access数据库问题
- C#如何生成随机6位数密码,请教?
- 一个datagrid分页的想法。不只可行否?
- Iframe问题
- 有办法获得各进程占用的CPU吗?
这条语句不加后面条件,我在查询分析器里试了,是可以的.
{
if(!IsPostback)
{
DataSet ds=new DataSet();
ds=得到的结果集
this.DataGrid1.DataSource=ds.Table[0];
this.DataGrid1.DataBind();
}
}