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

AjaxÎÞË¢ÐÂ×Ô¶¯·¢ËÍÓʼþ

Ó¦ÏîÄ¿ÐèÇ󣬲âÊÔÁËÏÂ×Ô¶¯·¢ËÍÓʼþµÄ¹¦ÄÜ£¬ÒÔʵÏÖ£¬ÏÂÃæ·Ö±ð½éÉÜǰ̨µÄAjaxºÍºǫ́c#
ǰ̨£º
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SendEmail.aspx.cs" Inherits="SendEmail" %>
<!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>ÿ¸ôÊ®Ãë鐘×Ô動發ËÍEmail</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <asp:Timer ID="Timer1" runat="server" Interval="10000" ontick="Timer1_Tick">
     </asp:Timer>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </ContentTemplate>
    </asp:UpdatePanel>
    <div>
    </div>
    </form>
</body>
</html>
----------------------------------------------------------------------------------------------------------------------------------------------
ºǫ́£º
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net.Mail;
public partial class SendEmail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
   


Ïà¹ØÎĵµ£º

ajaxÏòservlet´«µÝÊý¾Ý£¬·µ»ØÂÒÂëµÄ½â¾ö·½·¨

ÒòΪAJAXĬÈϵÄÊÇUTF-8£¬ËùÒÔ½«JSPÒ³ÃæºÍºǫ́servletµÄ±àÂë¸ñʽ¶¼ÉèÖÃΪUTF-8×îºÃ£¬Ò²ÓÐÀûÓÚÒÔºóµÄÀ©Õ¹¡£
È»ºóÔÚ¶ÔÓ¦µÄ¸ñʽÏÂÃæ£¨dopost»òÕßdoget£©£¬¼ÓÉÏÕ⼸¾ä
response.setContentType("text/html");
 request.setCharacterEncoding("utf-8");
 response.setCharacterEncoding("UTF-8");
±¾ÈËÇײ⣬µ¯³öµ ......

AjaxÖеÄreadyStateºÍstatus

AjaxÖеķµ»Ø×´Ì¬readyStateºÍstatus,Ô­À´Ã»ÓÐÖØÊÓ¹ýÕâÁ½ÕߵĹØÏµ£¬½á¹û½ñÌìд´úÂëʱ³ö²î´íÁË¡£ÎÒµÄÔ­´úÂëΪ£º
function requestSome()
{
  url=......
  xmlHttpRequest.open....
  xmlHttpRequest.onreadystatechange = function responseSome();
  xmlHttpRequest.send....
}
function resp ......

asp.netÀûÓÃjqueryµÄajax·½·¨À´ÑéÖ¤µÇ½µÄ´úÂë

Ðí¶à³ÌÐòÔ±ÔÚ×öÒµÎñ¿ª·¢Ê±ÍùÍù»áÔÚ·þÎñÆ÷¶Ë×öÓû§ÐÅÏ¢µÄÑéÖ¤£¬ÓÐûÓп¼ÂǹýÓÃjqueryµÄajax·½·¨À´ÑéÖ¤µÇÂ½ÄØ£¿ÇÒЧ¹û±ÈÔÚ·þÎñÆ÷¶Ëд´úÂëÀ´ÑéÖ¤ºÃµÄ¶à£¬Ò³ÃæÎÞˢм´¿ÉʵÏÖʵÏֵǽÑéÖ¤£¬´úÂëÒ²¼òµ¥¡£
ÏÖÔÚÏÂÃæÌù³öÀ´µÄÊǺܼòµ¥µÄÓÃjqueryµÄajax·½·¨À´ÑéÖ¤µÇ½µÄ´úÂ룬ÊʺϸսӴ¥jqueryµÄÅóÓÑѧϰ¡£
Ç°Ì¨Ò³Ãæ´úÂ룺
<he ......

ÔÚasp.net AJAX¿Í»§¶ËʹÓø´ÔÓÊý¾ÝÀàÐÍ·½·¨

<script language="javascript" type="text/javascript"> 
¡¡¡¡function doubleSalary()
¡¡¡¡{
¡¡¡¡var employee = new Object();
¡¡¡¡employee.FirstName = "X";
¡¡¡¡employee.LastName = "PP";
¡¡¡¡employee.Salary = 1000;
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ