All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
SQL,SERVER,2005中全新的OUTPUT子句添加数据记录详解(理论篇)_mssql学习_编程技术
asp.net(c#)如何把字符串转换成数组_[Asp.Net教程]
PHP入门:动态网页制作技术PHP的常量类型_[PHP教程]
asp.net2.0内置Application对象的应用
ASP.NET中实现多文件上传的实例程序代码_[Asp.Net教程]
验证控件的气泡提示效果_[Asp.Net教程]
将ASP.NET,Control转换为String_[Asp.Net教程]
探讨一种AJAX性能的改进方法_[Asp.Net教程]
内外网同时访问问题:用JS判断访问计算机IP_JavaScript技术_编程技术
c#中DateTime函数的各种显示效果_[Asp.Net教程]
Reading number is top 10 pictures
移民小国也实惠1
Kim jong il's mistress, national beauty JinYuJi actor2
The real super beauty10
A cat have life principles
The money of more than 100 countries and regions1
如果我是导演...
Nikon microscopic photography of the first three
The hot big eye big breast beauty3
美女浴室写真3
8090后结婚的各种XX事
Download software ranking
Ashlynn Video4
SP4 for SQL2000
Boxer's Top ten classic battle4
Boxer's Top ten classic battle5
VeryCD电驴(EasyMule) V1.1.9 Build09081
Boxer's Top ten classic battle8
Ashlynn Video3
Love the forty days
Sora aoi‘s film--Lust fan wall
传奇私服架设教程
aaa published in(发表于) 2013/12/13 9:38:44 Edit(编辑)
Ajax+GridView+Xml的简易留言薄_.net资料_编程技术

Ajax+GridView+Xml的简易留言薄_.net资料_编程技术

Ajax+GridView+Xml的简易留言薄_.net资料_编程技术-你的首页-uuhomepage.com

aspx文件
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>


http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
http://www.w3.org/1999/xhtml">

无标题页























用户姓名:<%#Eval("name") %>留言时间:<%#Eval("sdate")%>








留言内容:<%#Eval("couent")%>










&nbsp; &nbsp;&nbsp;





姓名



留言内容













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;


public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BindData();
}
}
private void BindData()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("XMLFile.xml"));
GridView1.DataSource = ds;
GridView1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet("my");
ds.ReadXml(Server.MapPath("XMLFile.xml"));//读取xml文件
DataRow dr = ds.Tables[0].NewRow();
dr["name"] = TextBox1.Text.ToString();
dr["couent"] = TextBox2.Text.ToString();
dr["sdate"] = DateTime.Now;
ds.Tables[0].Rows.Add(dr);
ds.WriteXml(Server.MapPath("XMLFile.xml"));//写入xml文件
Response.Redirect("default.aspx");

}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
BindData();
}
}
xml文件



xiaoxiao
xiaoxoao
2006-11-14 21:06:14


在此下载代码http://www.cnblogs.com/Files/TeaGreen/liuyanbo.rar






添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.