Ajax 基础 (asp.net C#)
<script type="text/javascript">
var xmlHttp;
function createXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(n)
{
var send_string="id="+n;
send_string= encodeURI(send_string)
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET","ReadDate.asp",true);
// xmlHttp.setRequestHeader("cache-control","no-cache");
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHtt
相关文档:
在web config中 作如下配置:
<connectionStrings>
<add name="ydycon" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=|DataDirectory|ydy.mdb" providerName="System.Data.OleDb"/>
</connectionStrings>
在.net文件中应用链接 ......
public static void Main()
{
WebRequest req = WebRequest.Create("http://blog.csdn.net/xiaofengsheng");
try
& ......
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace SinvanCMS.Common
{
/// <summary>
/// 全局类,当前域名,物理路径
/// </summary>
public class Application
&nb ......
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" ......
//TransmitFile实现下载
protected void Button1_Click(object sender, EventArgs
e)
{
/*
微软为Response对象提供了一个新的方法TransmitFile来解决使用Response.BinaryWrite
......