• 大小: 5.27MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-06
  • 语言: C#
  • 标签: asp.net  

资源简介

本程序是用vs2005+Sql Server2005做的asp.net通讯录管理系统,非常适合初学者使用

资源截图

代码片段和文件信息

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 ADDsort1 : System.Web.UI.Page
{
    protected void Page_Load(object sender EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session[“userID“] == null || Session[“userID“].ToString() == ““)
            {

                Page.Response.Redirect(“default.aspx“);
            }
            else
            {
               
                dataBind();

            }

        }
    }
    private void dataBind()
    { 
       
        string id = Session[“userID“].ToString();
        string sql = “select * from sorttable where clientID=‘“ + id + “‘ order by wid asc“;
        Database db = new Database();
        DataSet ds = db.DataAll(sql);
        GridView1.DataSource = ds;
        GridView1.DataKeyNames = new string[] { “wid“ };
        GridView1.DataBind();
        return;

    }
    protected void GridView1_PageIndexChanging(object sender GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        GridView1.EditIndex = -1;
        dataBind();
    }

    protected void GridView1_RowEditing(object sender GridViewEditEventArgs e)
    {
        GridView1.EditIndex = e.NewEditIndex;
        dataBind();
    }
    protected void GridView1_RowCancelingEdit(object sender GridViewCancelEditEventArgs e)
    {
        GridView1.EditIndex = -1;
        dataBind();
    }
    protected void GridView1_RowCommand(object sender GridViewCommandEventArgs e)
    {


        if (e.CommandName == “Insert“)
        {
            string newname = ((TextBox)GridView1.FooterRow.Cells[0].FindControl(“txtnewname“)).Text.Trim();
            string newnumber = ((TextBox)GridView1.FooterRow.Cells[1].FindControl(“txtnewno“)).Text.Trim();
            int i = sortnumberValidate(newnumber);
            if (i == 0)
            {




                if (newname == ““ || newnumber == ““)
                {
                    lblmsg.Text = “注意不能为空!“;
                    lblmsg.style[“color“] = “red“;
                    return;
                }
                else
                {

                    string newid = Session[“useriD“].ToString();
                    string sql = “insert into sorttable(sortnamesortnumberclientID) values (‘“ + newname + “‘‘“ + newnumber + “‘‘“ + newid + “‘)“;
                    Database db = new Database();
                    if (db.Execute(sql))
                    {
                        lblmsg.Text = “数据添加成功!“;
                        lblmsg.style[“color“] = “red“;
                        GridView1.EditIndex = -1;
                        dataBind();
                    }
                    e

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4480  2009-01-01 00:43  mostlyData.aspx

     文件       2320  2009-01-01 01:29  mostlyData.aspx.cs

     文件      10078  2009-01-01 00:39  Register.aspx

     文件       6935  2009-01-01 15:00  Register.aspx.cs

     文件       3400  2009-01-01 00:14  selectData.aspx

     文件       3957  2009-01-01 00:46  selectData.aspx.cs

     文件       1591  2009-01-01 02:53  Showfriendinf.aspx

     文件       2100  2009-01-01 02:54  Showfriendinf.aspx.cs

     文件        939  2009-01-01 01:07  ThankYou.aspx

     文件        933  2009-01-01 00:24  ThankYou.aspx.cs

     文件       2418  2009-02-09 09:04  Web.config

     文件      32256  2009-02-09 09:04  狂龙通讯管理系统09牛年版.doc

     文件       2538  2009-02-09 09:10  51aspx源码必读.txt

     文件       4945  2007-07-18 09:38  from.gif

     文件        125  2007-03-27 14:33  最新Asp.Net源码下载.url

     文件       1109  2009-07-01 00:50  App_Code\amendPassword.cs

     文件       3567  2009-07-01 00:50  App_Code\Attribute.cs

     文件       6314  2009-01-01 00:43  App_Code\Database.cs

     文件       1404  2009-01-01 00:24  App_Code\ddlselect.cs

     文件       1231  2009-07-01 00:50  App_Code\GetValue.cs

     文件       3380  2009-01-01 14:50  App_Code\operation.cs

     文件        924  2009-01-01 00:47  App_Code\popData.cs

     文件    1179648  2009-02-09 09:18  App_Data\Address_Data.MDF

     文件    1048576  2009-02-09 09:18  App_Data\Address_Log.LDF

     文件        248  2009-01-22 06:26  control\ReturnHomepage.ascx

     文件        430  2009-01-22 06:21  control\ReturnHomepage.ascx.cs

     文件      40339  2009-01-31 21:31  image\025.gif

     文件      44565  2008-11-01 16:50  image\069cq[1].gif

     文件     152107  2009-01-30 22:13  image\11.jpg

     文件       3612  2008-07-26 21:47  image\56logo.gif

............此处省略77个文件信息

评论

共有 条评论