aspx页面:
复制代码 代码如下:
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Height="50px"
Width="500px" OnModeChanging="DetailsView1_ModeChanging" OnItemDeleting="DetailsView1_ItemDeleting"
OnItemUpdating="DetailsView1_ItemUpdating" OnItemInserting="DetailsView1_ItemInserting">
<Fields>
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<%#Eval("Id") %>
</ItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtInsertId" Text="InsertId" runat="server"/>
</InsertItemTemplate>
<EditItemTemplate>
<%#Eval("Id") %>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Title">
<ItemTemplate>
<%#Eval("Title") %>
</ItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtInsertTitle" Text="InsertTitle" runat="server"/>
</InsertItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtEditTitle" Text='<%# Eval("Title") %>' runat="server"/>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Context">
<ItemTemplate>
<%# Eval("LogContext") %>
</ItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtInsertLogContext" Text="InsertLogContext" runat="server"/>
</InsertItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtEditLogContext" Text='<%# Eval("LogContext") %>' runat="server"/>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="操作">
<ItemTemplate>
<asp:Button ID="btnEdit" runat="server" CausesValidation="False"
CommandName="Edit" Text="编辑" />
<asp:Button ID="btnNew" runat="server" CausesValidation="False"
CommandName="New" Text="新建" />
<asp:Button ID="btnDelete" runat="server" CausesValidation="False"
CommandName="Delete" Text="删除" OnClientClick="return confirm('确定要更新该学生信息吗?');" />
</ItemTemplate>
<InsertItemTemplate>
<asp:Button ID="btnInsert" runat="server" CausesValidation="True"
CommandName="Insert" Text="插入" />
<asp:Button ID="btnCancel" runat="server" CausesValidation="False"
CommandName="Cancel" Text="取消" />
</InsertItemTemplate>
<EditItemTemplate>
<asp:Button ID="btnUpdate" runat="server" CausesValidation="True"
CommandName="Update" Text="更新" OnClientClick="return confirm('确定要更新该学生信息吗?');" />
<asp:Button ID="btnCancel2" runat="server" CausesValidation="False"
CommandName="Cancel" Text="取消" />
</EditItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
CS文件:
复制代码 代码如下:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataToBing();
}
}
private void DataToBing()
{
this.DetailsView1.DataSource = DataGridSource();
this.DetailsView1.DataBind();
}
private List<Log> DataGridSource()
{
List<Log> logs = new List<Log>();
for (int i = 1; i < 11; i++)
{
Log log = new Log();
log.Id = i;
log.Title = "标题" + i;
log.LogContext = "内容" + i;
logs.Add(log);
}
return logs;
}
public class Log
{
private int id;
public int Id
{
get { return id; }
set { id = value; }
}
private string title;
public string Title
{
get { return title; }
set { title = value; }
}
private string logContext;
public string LogContext
{
get { return logContext; }
set { logContext = value; }
}
}
protected void DetailsView1_ModeChanging(object sender, DetailsViewModeEventArgs e)
{
this.DetailsView1.ChangeMode(e.NewMode);
DataToBing();
}
protected void DetailsView1_ItemDeleting(object sender, DetailsViewDeleteEventArgs e)
{
Response.Write("删除操作");
}
protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
TextBox tbTitle = (TextBox)this.DetailsView1.FindControl("txtEditTitle");
TextBox tbLogContext = (TextBox)this.DetailsView1.FindControl("txtEditTitle");
Response.Write("更新操作 : Title : " + tbTitle.Text + " : LogContext : " + tbLogContext.Text);
}
protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
{
Response.Write("插入操作 : ");
}
}
复制代码 代码如下:
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Height="50px"
Width="500px" OnModeChanging="DetailsView1_ModeChanging" OnItemDeleting="DetailsView1_ItemDeleting"
OnItemUpdating="DetailsView1_ItemUpdating" OnItemInserting="DetailsView1_ItemInserting">
<Fields>
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<%#Eval("Id") %>
</ItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtInsertId" Text="InsertId" runat="server"/>
</InsertItemTemplate>
<EditItemTemplate>
<%#Eval("Id") %>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Title">
<ItemTemplate>
<%#Eval("Title") %>
</ItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtInsertTitle" Text="InsertTitle" runat="server"/>
</InsertItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtEditTitle" Text='<%# Eval("Title") %>' runat="server"/>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Context">
<ItemTemplate>
<%# Eval("LogContext") %>
</ItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="txtInsertLogContext" Text="InsertLogContext" runat="server"/>
</InsertItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtEditLogContext" Text='<%# Eval("LogContext") %>' runat="server"/>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="操作">
<ItemTemplate>
<asp:Button ID="btnEdit" runat="server" CausesValidation="False"
CommandName="Edit" Text="编辑" />
<asp:Button ID="btnNew" runat="server" CausesValidation="False"
CommandName="New" Text="新建" />
<asp:Button ID="btnDelete" runat="server" CausesValidation="False"
CommandName="Delete" Text="删除" OnClientClick="return confirm('确定要更新该学生信息吗?');" />
</ItemTemplate>
<InsertItemTemplate>
<asp:Button ID="btnInsert" runat="server" CausesValidation="True"
CommandName="Insert" Text="插入" />
<asp:Button ID="btnCancel" runat="server" CausesValidation="False"
CommandName="Cancel" Text="取消" />
</InsertItemTemplate>
<EditItemTemplate>
<asp:Button ID="btnUpdate" runat="server" CausesValidation="True"
CommandName="Update" Text="更新" OnClientClick="return confirm('确定要更新该学生信息吗?');" />
<asp:Button ID="btnCancel2" runat="server" CausesValidation="False"
CommandName="Cancel" Text="取消" />
</EditItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
CS文件:
复制代码 代码如下:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataToBing();
}
}
private void DataToBing()
{
this.DetailsView1.DataSource = DataGridSource();
this.DetailsView1.DataBind();
}
private List<Log> DataGridSource()
{
List<Log> logs = new List<Log>();
for (int i = 1; i < 11; i++)
{
Log log = new Log();
log.Id = i;
log.Title = "标题" + i;
log.LogContext = "内容" + i;
logs.Add(log);
}
return logs;
}
public class Log
{
private int id;
public int Id
{
get { return id; }
set { id = value; }
}
private string title;
public string Title
{
get { return title; }
set { title = value; }
}
private string logContext;
public string LogContext
{
get { return logContext; }
set { logContext = value; }
}
}
protected void DetailsView1_ModeChanging(object sender, DetailsViewModeEventArgs e)
{
this.DetailsView1.ChangeMode(e.NewMode);
DataToBing();
}
protected void DetailsView1_ItemDeleting(object sender, DetailsViewDeleteEventArgs e)
{
Response.Write("删除操作");
}
protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
TextBox tbTitle = (TextBox)this.DetailsView1.FindControl("txtEditTitle");
TextBox tbLogContext = (TextBox)this.DetailsView1.FindControl("txtEditTitle");
Response.Write("更新操作 : Title : " + tbTitle.Text + " : LogContext : " + tbLogContext.Text);
}
protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
{
Response.Write("插入操作 : ");
}
}
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?
更新日志
2024年11月19日
2024年11月19日
- 小骆驼《草原狼》[正版CD抓轨WAV+CUE]
- 群星.2011-剧集金曲精选2CD【永恒】【WAV+CUE】
- 林忆莲.1996-夜太黑【滚石】【WAV+CUE】
- 方皓玟.2009-UNLOCKME【东亚】【WAV+CUE】
- 群星《2024好听新歌22》十倍音质 U盘音乐[WAV分轨]
- 林宥嘉《神秘嘉宾》引进版[WAV分轨][1G]
- 2024罗志祥《舞狀元》[FLAC/MP3][1G]
- 张美玲侯俊辉1999-福建情歌对唱[南方][WAV+CUE]
- 江希文.1994-伝说少女(饿狼伝说动画原声大碟)【嘉音】【WAV+CUE】
- 黄思婷2020-风中泪[豪记][WAV+CUE]
- 刘韵.1998-DENON.MASTERSONIC系列【EMI百代】【WAV+CUE】
- 群星.2024-你的谎言也动听影视原声带【韶愔音乐】【FLAC分轨】
- 群星.2003-难忘的影视金曲·港台篇【正大国际】【WAV+CUE】
- 试音天碟《原音HQCD》风林 [WAV+CUE][1.1G]
- 李思思《喜欢你》头版限量编号24K金碟[低速原抓WAV+CUE][1.1G]