AJAX ºǫ́Ôõôȡ²»µ½Ö± - .NET¼¼Êõ / ASP.NET
´úÂëÈçÏ Çë¸ßÊÖ Ö¸µãÏ лл
ajax_http.js
-------------
function getXMLHTTP() {
var xmlhttp;
if (window.ActiveXObject) {
//IE
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
xmlhttp = new ActiveXObject("Msxml2.XMLHTP");
}
} else {
//FireFox
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
var XMLHttpObj;
function addTestInfo1() {
XMLHttpObj = getXMLHTTP();
// var subName = document.getElementById("D1").value;
var txtTitle = document.getElementById("txt").value;
var txtA = document.getElementById("txtA").value;
var txtB = document.getElementById("txtB").value;
var txtC = document.getElementById("txtC").value;
var txtD = document.getElementById("txtD").value;
var txtQuestion = document.getElementById("txt1").value;
var txtFenS = document.getElementById("txt2").value;
XMLHttpObj.open("POST", "checkTestInfo.aspx?TestTitle=" + txtTitle + "&am
Ïà¹ØÎÊ´ð£º
ÎÒÏÖÔÚÓÃstruts2¿ò¼Ü,ÐèҪʹÓÃajaxʵÏÖ¾Ö²¿Ë¢Ð£¬µ«ÊÇ´ÓÈÝÆ÷Àï·µ»ØµÄÖµ²»ÖªµÀÔõô´Óstruts.xmlÅäÖÃÎļþÀïÓ³Éäµ½jspÒ³ÃæÀÒÔÇ°servletÀïдout.orint("xxxxx")¾Í¿ÉÒԵõ½~£¬µ«ÊÇÏÖÔÚÓÃstruts¾Í²»ÖªµÀÔõôР......
±¾ÈËÊDzËÄñÒ»¸ö£¬Æ½Ê±Òª×öÉúÒ⣬µ«ÊÇÕÒÁ˺ܶàÈË×öÍøÕ¾£¬¾ù±»ÆÁË¡£×öµÃ²»Èý²»ËÄ£¬ÏÖÔÚ¾öÐÄ×Ô¼ºÀ´×öÒ»¸ö£¬ÒÑѧϰASP.NETÏà¹ØµÄÍøÒ³ÖÆ×÷֪ʶ£¬ÓÐDW»ù´¡£¬¿ÉÒÔ˵ÊÇÄ¿Ç°Ö»ÓÐÀíÂÛ֪ʶ£¬µ«ÊÇÔÚʵ¼Ê¾ßÌå²Ù×÷µÄʱºò£¬×ÜÊÇÓöµ ......
´úÂëÖУ¬Èç¹û½«//alert(1)¡¡×¢ÊÍ´ò¿ª£¬ÄÇô¾Í¿ÉÒÔµ÷Óã¬Èç¹û×¢Ê͵ô¾ÍÎÞ·¨µ÷ÓÃ
»³ÒÉÊǵ¼JSÎļþ³öÎÊÌâÁË£¬ÒòΪд¹ýjspÒýÁ½¸öJSÎļþûÎÊÌ⣬
¶øJSPÒýÒ»¸öJSÎļþ£¬Õâ¸öJSÒý±ðÍâµÄJSÎļþ³öÏÖÏÂÃæÎÊÌ⣬ÉÏÍøÕÒÁË°ëÌìû½á ......
¾ÍÊÇÒ»¸ö°´Å¥£¬µã»÷Ö®ºó´ò¿ª¶Ô»°¿ò£¬È»ºóѡȡͼƬ¡£¾ÍÕâÑùÉÏ´«¡£¡£
ÔõôʵÏÖ¡£ÔÚÍøÉÏËѵ½ÄÇô¶àµÄ´úÂ룬ȫÊǺܶàµÄÄÇÖÖ£¬²»ÖªµÀ£¬¿´²»ÏÂÈ¥¡£
ËùÒÔÔÚÕâÀïÏëÇë´ó¸ç´ó½ã°ï°ïæ¡£
ʹÓÃ×Ô´øµÄfileupload¿Ø¼þ¿ÉÒÔʵÏÖ ......
C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.InteropServices;
nam ......