Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

c#ÖеÄAjaxÉÏÊÖƪ£­£­£­·Çͬ²½ÇëÇóresponseXML

ÉÏƪ½éÉÜÁËÈçºÎÔÚAjax¿Í»§¶ËÓë·þÎñÆ÷¶ËÖ®¼ä´«Ëͼòµ¥µÄÎı¾Êý¾Ý£¬Æäʵ£¬Ò²¿ÉÒÔʹÓÃXML×÷ΪÊý¾Ý´«ËÍ¡¢¹µÍ¨µÄ¸ñʽ£¬Ajax¿Í»§¶ËÈôÒª·¢ËÍXML£¬»ù±¾ÉϾÍÊǽ«XML×÷Ϊ×Ö·û´®£¬ÔÚPOSTÇëÇóʱ·¢ËÍ£¬ÀýÈ磺
*HelloAjax.js
var xmlHttp;
function createXMLHttpRequest() {
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
function prepareXML() {
var xml = "<skills>";
var options = document.getElementById("skills").childNodes;
for (var i = 0; i < options.length; i++) {
var option = options[i];
if (option.selected) {
xml = xml + "<skill>" + option.value + "<\/skill>";
}
}
xml = xml + "<\/skills>";
return xml;
}
function handleSkills() {
var xml = prepareXML();
var url = "Handler1.ashx?timeStamp=" + new Date().getTime();
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("POST", url);
xmlHttp.setRequestHeader("Content-Type", "text/xml");
xmlHttp.send(xml);
}

ÔÚÉÏÀýÖУ¬½«¿Í»§¶ËÔÚ¶àÑ¡ÔñÏÂÀ­¿òÖÐÑ¡ÔñµÄÊý¾Ý£¬ÒÔÏÂÁеÄXML¸ñʽ·¢ËÍ£º
<skills>
<skill>java</skill>
<skill>vb</skill>
<skill>csharp</skill>
</skills>

·þÎñÆ÷¶Ë²ÉÓÃHttpHandlerʵÏÖ£¬ÔÚ·þÎñÆ÷¶Ë½ÓÊÕµ½XMLÖ®ºó£¬Õë¶ÔXML¼ÓÒÔÆÊÎö£¬È¡µÃÿ¸öNODEÊý¾Ý¡£
²¢»áÒÔÁíÒ»¸öXMLÎļþÖØз¢»Ø¿Í»§¶Ë¡£
*Hanler1.ashx
using System.Text;
using System.Web;
using System.Xml;
using System.Globalization;
namespace HelloAjax
{
public class Handler1 : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
HttpRequest Request = context.Request;
HttpResponse Response = context.Response;
if (Request.InputStream.Length != 0)


Ïà¹ØÎĵµ£º

AJAXÔÚPHPÖеļòµ¥Ê¹ÓÃ

¡¡[AJAX½éÉÜ]
¡¡¡¡AjaxÊÇʹÓÿͻ§¶Ë½Å±¾ÓëWeb·þÎñÆ÷½»»»Êý¾ÝµÄWebÓ¦Óÿª·¢·½·¨¡£WebÒ³Ãæ²»Óôò¶Ï½»»¥Á÷³Ì½øÐÐÖØмӲ㬾ͿÉÒÔ¶¯Ì¬µØ¸üС£Ê¹ÓÃAjax£¬Óû§¿ÉÒÔ´´½¨½Ó½ü±¾µØ×ÀÃæÓ¦ÓõÄÖ±½Ó¡¢¸ß¿ÉÓᢸü·á¸»¡¢¸ü¶¯Ì¬µÄWebÓû§½çÃæ¡£
¡¡¡¡Òì²½JavaScriptºÍXML£¨AJAX£©²»ÊÇʲôм¼Êõ£¬¶øÊÇʹÓü¸ÖÖÏÖÓм¼Êõ——°ü ......

xtree dwr (ajax)Òì²½¼ÓÔØÿ¸öÊ÷½áµãµÄ´úÂë

 tree.js
function getRank(rankNum)
{
 var rankName="";
 switch(rankNum)
 {
  case 1:
   {
    rankName="(ÆÕͨ»áÔ±)";
    break;
   }
   case 2:
   {
 &n ......

·â×°Ò»¸ö¼òµ¥µÄAjaxº¯Êý

/**
* Ajax²Ù×÷º¯Êý
*
* @param url -- ·þÎñÆ÷¶ËÒ³ÃæµØÖ·
* @param param -- ²ÎÊý£¬ÀàËÆ 'user=123&id=100'
* @param method -- ÇëÇó·þÎñÆ÷¶ËµÄ·½·¨,GetºÍPostÁ½ÖÖ£¬Ä¬ÈÏÊÇGET
* @param response -- ÊÇ·ñ»ñÈ¡·þÎñÆ÷¶Ë·µ»ØµÄ½á¹û£¬Ä¬ÈÏÊÇtrue
*/
function ajax( url, param, method, response ){
//set defaul ......

΢ÈíÐû²¼AJAX CDN

 Ô­ÎĵØÖ·¡¿Announcing the Microsoft AJAX CDN
¡¾Ô­ÎÄ·¢±íÈÕÆÚ¡¿ Tuesday, September 15, 2009 11:46 PM
½ñÌìÔçЩʱºò£¬ASP.NET¿ª·¢ÍŶÓÍƳöÁËÒ»¸öеÄ΢ÈíAjax CDN£¨Content Delivery Network£¬ÄÚÈÝ·Ö·¢ÍøÂ磩·þÎñ£¬¸Ã·þÎñÌṩÁ˶ÔAJAX¿â£¨°üÀ¨jQuery ºÍ ASP.NET AJAX£©µÄ»º´æÖ§³Ö¡£¸Ã·þÎñÊÇÃâ·ÑµÄ£¬²»ÐèÈκÎ×¢² ......

c# SQLÊý¾Ý¿âÔ¶³ÌÁ¬½Ó¼°ÅäÖ÷½·¨

Ò»£ºC# Á¬½ÓSQLÊý¾Ý¿â
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
Server=myServerAddress;Database=myDataBase;User ID=myUse ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ