【www.gdgbn.com--WebService】

<%@ page language="c#" autoeventwireup="true" codefile="default.asp教程x.cs" inherits="test_jquery_dialog_default" %>



无标题页


<script type="text/网页特效" src="网页特效/jquery-1.4.2.min.js"></script>
<script src="js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(
function (){
$("#dialog").dialog({
autoopen: false,
width: 600,
buttons: {
"ok": function() {
alert("ok");
$(this).dialog("close");
},
"cancel": function() {
alert("cancel");
$(this).dialog("close");
}
}
});
}
)
function show()
{
$("#dialog").dialog("open");
}
function ajax1()
{
$.ajax({
type:"get",
url:"action/test.ashx",
data:{"time":math.random()},
beforesend:function(xmlhttprequest)
{
},
success:function(msg)
{
alert(msg);
}
});
}
function ajax2()
{
$.ajax({
type:"post",
contenttype: "application/json",
url:"action/webservice.asmx/helloworld",
data:{},
datatype: "json",
success:function(msg)
{
alert(msg);
}
});
}
function ajax3(setvalue1,setvalue2)
{
if(setvalue1.length==0||setvalue2.length==0)
{
alert("请将两个文本框输入完整!");
return false;
}
$.ajax({
type:"post",
contenttype: "application/json",
url:"action/webservice.asmx/helloa",
data:"{a:""+setvalue1+"",b:""+setvalue2+""}",
datatype: "json",
success:function(msg)
{
alert(msg);
}
});
}
//返回集合
function ajax4()
{
$.ajax({
type: "post",
contenttype: "application/json",
url: "action/webservice.asmx/getarray",
data: "{"i":"10"}",
success: function(msg) {
alert(msg);
}
});
}
//返回复合类型
function ajax5()
{
$.ajax({
type: "post",
contenttype: "application/json",
url: "action/webservice.asmx/getclass",
data: "{}",
success: function(msg) {
$(msg).each(function() {
alert(msg["id"]+"___"+msg["value"]);
});
}
});
}
//返回dataset
function ajax6()
{
$.ajax({
type: "post",
url: "action/webservice.asmx/getdataset",
data: "{}",
datatype:"xml",
success: function(msg) {
$(msg).find("table1").each(function() {
alert($(this).find("id").text()+"___"+$(this).find("value").text());
});
}
});
}
</script>



webservice参数1

webservice参数2








in dialog!



本文来源:http://www.gdgbn.com/asp/26158/