jQuery Ajax ·½·¨µ÷Óà Asp.Net WebService µÄÏêϸÀý×Ó
http://www.cnblogs.com/TerryFeng/archive/2009/02/01/1382123.html
ÕâºÜ³£Óã¬ËÑË÷ÁËһϲ©¿ÍÔ°µÄ“ÕÒÕÒ¿´”ºÍ¹È¸è£¬¿´µ½´ó²¿·Ö¶¼ÊÇ×ªÔØÓÚÒ»Á½ÆªÎÄÕ£¨¶øÇÒÀ´Ô´»¹²»ÊDz©¿ÍÔ°£©£¬ÓеÄÊǼòµ¥µÄ˵һµãÎÞ·¨ÔËÐУ¬¸ø³õѧÕߵĵ÷ÊÔºÍѧϰ´øÀ´²»·½±ã£¬ÎÒÔÚÕâÀォjQuery Ajax µ÷ÓÃAspx.Net WebService µÄ¼¸¸ö³£Óõķ½·¨×öÁËÒ»¸öÕûÀí£¬Ìṩ¸øÕýÔÚÕÒÕâ·½ÃæÄÚÈݵIJ©ÓÑ£¬Ï£ÍûÄܸøÑ§Ï°jQueryµÄÅóÓÑÒ»µã°ïÖú£¬¿ÉÒÔÖ±½Ó¸´ÖÆ´úÂëÔËÐС£
ws.aspx ´úÂë
<!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 id="Head1" runat="server">
<title></title>
<script src="jquery.js" type="text/javascript"></script>
<style type="text/css">
.hover
{
cursor: pointer; /*СÊÖ*/
background: #ffc; /*±³¾°*/
}
.button
{
width: 150px;
float: left;
text-align: center;
margin: 10px;
padding: 10px;
border: 1px solid #888;
}
#dictionary
{
text-align: center;
font-size: 18px;
clear: both;
border-top: 3px solid #888;
}
#loading
{
border: 1px #000 solid;
background-color: #eee;
padding: 20px;
margin: 100px 0 0 200px;
position: absolute;
display: none;
}
#switcher
{
}
</style>
<script type="text/javascript">
//ÎÞ²ÎÊýµ÷ÓÃ
$(document).ready(function() {
$('#btn1').click(function() {
$.ajax({
type: "POST", //·ÃÎÊWebServiceʹÓÃPost·½Ê½ÇëÇó
contentType: "application/json", //WebService »á·µ»ØJsonÀàÐÍ
url: "WebService1.asmx/HelloWorld", //µ÷ÓÃWebServiceµÄµØÖ·ºÍ·½·¨
Ïà¹ØÎĵµ£º
ASP.Net 1.1ºóÒýÈëÁ˶ÔÌá½»±íµ¥×Ô¶¯¼ì²éÊÇ·ñ´æÔÚXSS(¿çÕ¾½Å±¾¹¥»÷)µÄÄÜÁ¦¡£µ±Óû§ÊÔͼÓÃÖ®ÀàµÄÊäÈëÓ°ÏìÒ³Ãæ·µ»Ø½á¹ûµÄʱºò£¬ASP.NetµÄÒýÇæ»áÒý·¢Ò»¸ö HttpRequestValidationExceptioin¡£Ä¬ÈÏÇé¿öÏ»᷵»ØÈçÏÂÎÄ×ÖµÄÒ³Ãæ£º
ÒÔÏÂÊÇÒýÓÃÆ¬¶Î£º
Server Error in '/YourApplicationPath' Application
A potentially dangerou ......
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using ......
¹ØÓÚASP.NETÒ³Ãæ´òÓ¡¼¼ÊõµÄ×ܽá
B/S½á¹¹µ¼ÖÂÁËWebÓ¦ÓóÌÐòÖдòÓ¡µÄÌØÊâÐÔ¡£
¡¡¡¡• ³ÌÐòÔËÐÐÔÚä¯ÀÀÆ÷ÖУ¬´òÓ¡»úÔÚ±¾µØ£¬¶øÎļþÈ·¿ÉÄÜÔÚ·þÎñÆ÷ÉÏ£¬µ¼ÖÂÁË´òÓ¡¿ØÖƲ»ÊǺÜÁé»î¡£
¡¡¡¡• ¸ñʽÈçºÎ¿ØÖƺͶ¨ÖƵȣ¬ÊÇÎÒÃÇ¿ª·¢ÖпÉÄÜ»áÃæ¶ÔµÄÎÊÌâ¡£
¡¡¡¡´òÓ¡ÎĵµµÄÉú³É
¡¡¡¡• 1¡¢ ......
×î½ü·ÃÎÊÁ˽¨ÐÐÍøÕ¾Ê± https://ibsbjstar.ccb.com.cn/V5/index.html#£¬£¨ÆäʵÔÚoblog,http://www.oblog.cnÒ²²ÉÓÃÁËÀàËÆµÄ¼¼ÇÉ£¬²»¹ý·½·¨²»Í¬°ÕÁË£©
¡¡¡¡¿ÉÒÔ·¢ÏÖ£¬µ±Ñ¡Ôñ²»Í¬µÄÎı¾¿ò£¬¿ÉÒÔ³öÏÖ²»Í¬µÄÑÕÉ«£¬ÒªÍê³ÉÕâ¸ö¹¦Äܼܺòµ¥£¬µ«ÊÇÈç¹ûÓкܶàÀàËÆµÄ¹¦ÄÜ£¬Èç¹ûÒ»¸ö¸öÉèÖÿؼþÑùʽÏÔÈ»ºÜÀÛ£¬Ò»¸ö¼òµ¥µÄ´¦Àí·½·¨Ð´Ò»¸ö·½· ......