All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
Ajax简单应用,检测用户名是否存在_[AJAX教程]

Writer: 归海一刀 Article type: Programming skills(编程技巧) Time: 2014/3/16 2:52:57 Browse times: 342 Comment times: 0

Ajax简单应用,检测用户名是否存在_[AJAX教程]


Head photo

Go homepage
Upload pictures
Write articles

Ajax简单应用,检测用户名是否存在_[AJAX教程]























客户端页面index.html







ajax测试用户名是否存在







onclick="javascript:HelloWorld();" />









服务器端功能页面Check.aspx




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 Check : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string str = "select Count(*) from Table where Name=" + Request.QueryString["id"].ToString() + "";
SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=Database;Integrated Security=True");
conn.Open();
SqlCommand cmd = new SqlCommand(str, conn);
int i = (int)cmd.ExecuteScalar();
conn.Close();
Response.Write(i);
}
}











































There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.