关于ASP.net与AJAX用gridview进实现无刷新并分页随笔
开发环境:WIN XP VS2005
数据库:SQL server 2000
此处不考虑安全问题.
具体如下:
首先建立一个数据库和一个表结构并在表中输入一些数据以便测试:此步略过
打开VS2005新建一个网站并添加一个HTML页
在默认的Default.aspx中放入Gridview控件用于显示数据
.cs代码
using System;
using System.Data;
using System.Configuration;
using System.Collections;
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.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
public int j = 0;
protected void Page_Load(object sender, EventArgs e)
{
databind();
}
/// <summary>
/// 分页
/// </summary>
private void databind()
{
string connStrings = ConfigurationManager.ConnectionStrings["WSConStringSQL"].ToString();
SqlConnection sqlconn = new SqlConnection(connStrings);
SqlCommand sqlcom = new SqlCommand("Select * from TB_AdminUser ", sqlconn);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(sqlcom);
da.Fill(ds);
PagedDataSource objPds = new PagedDataSource();
objPds.DataSource = ds.Tables[0].DefaultView;
objPds.AllowPaging = true;
objPds.PageSize = 5;
int CurPage;
&
相关文档:
1.下载组件:(要下载FCKeditor2.6.5.zip和FCKeditor.NET2.6.3版的2个zip包)
说明:
FCKeditor2.6.3.zip是其最新的文件和图片什么的;
FCKeditor.NET.zip是ASP.NET调用的DLL在里面。
2.分别解压后把FCKeditor2.6.3.zip里的fckeditor目录整个复制到网站中。
3.解压FCKeditor.NET.zip包后在FCKeditor.Net_2.2\bin\ ......
原文:刘武|在asp.net webservice中如何使用session
在使用asp.net编写webservice时,默认情况下是不支持session的,但我们可以把WebMethod的EnableSession选项设为true来显式的打开它,请看以下例子:
1 新建网站WebSite
2 新建web服务WebService.asmx,它具有以下两个方法:
C#-Code:
[WebMe ......
我们在使用html控件的时候提示换行分为三种方式:
第一种:
直接换行
<input type="text" tilte="pan
da">
第二种:
插入换行符号
<input type="text" tilte="pan da">
第三种:
<input type="text" tilte="pan da">
以上是html的提示换行!
如果我们在用到webControl的时候
就 ......
template.htm模板页源码:
1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2. <html xmlns="http://www.w3.org/1999/xhtml" >
3. <head>
4. <title ......
都知道在客户諯使用弹出框的是不能用MesssageBox来实现的.
一般都使用以下几种方法.
1) Button.Attributes.Add("onclick","javascript:return confirm('确定?');");
这种方法..现在使用最的多..
在www.csdn.net里有一文章就很好.
http://www.csdn.net/Develop/Read_Article.asp?Id=20892 ......