ASP.NET基于JQUERY的AJAX的验证登录(JSON)
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>主页</title>
<script src="js/jquery-1.2.6.js" type="text/javascript"></script>
<script src="js/thickbox.js" type="text/javascript"></script>
<link type="text/css" href="css/thickbox.css" rel="Stylesheet" />
</head>
<body>
<form id="form1" runat="server">
<div style="margin-left:auto; margin-right:auto;width:400px;">
<a href="ajaxLogin.html?height=120&width=250&modal=false" class="thickbox" title="请登录">
我要进行JQUERY登录验证</a>
<br />
账号:admin<br/>
密码:admin<br />
</div>
</form>
</body>
</html>
login.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>登录验证</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
login.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.We
相关文档:
ASP.NET中,若要将一个URL参数值赋值给一个变量,都得先判断参数是否存在,否则等待你的很可能就是"未将对象引用设置到对象的实例",以前都是
Request.QueryString["xx"] != null比较后再赋值,但今天在一个项目中发现竟还报错,代码大致结构如下:
复制内容到剪贴板
程序代码
int id = 0;
if (R ......
很多人都向在服务器端调用客户端的函数来操作,也就是在asp中调用javascript脚本中已经定义好的脚本函数。经过研究,发现了一些勉强的方法。
1. 用Response.Write方法写入脚本
比如在你单击按钮后,先操作数据库,完了后显示已经完成,可以在最后想调用的地方写上
Response.Write("<script type='text/javascrip ......
ASP.NET 3.5中6个内置的数据源控件分别用于特定类型的数据访问。
SqlDataSource 控件 允许访问支持ADO.NET数据提供程序的所有数据源。该控件默认可以访问ODBC、OLE DB、SQL Server、Orale和SQL Server CE 提供程序
LinqDataSource 控件 可以使用LINQ 查询访问不同类型的数据对象
O ......
var XmlHttp;
var PathUrl;
function createXmlHttp() {
if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
  ......
由于经常要写一些采集的程序,下面的三个函数是采集中的很常用的函数。姑且叫采集系统万能正则表达式吧。
第一个://获取页面的html源码
public string GetHtmlSource(string Url, string charset)
{
& ......