研究Ajax(二)WebService实现加 减 乘 除
2006-12-05 09:35
246 查看
环境:VS2005 并在http://ajax.asp.net/default.aspx?tabid=47&subtabid=471下载安装ASP.NET AJAX 1.0 Beta 2
效果:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<script type="text/javascript" language="JavaScript">
function Sum()
function Diff()
function Mul()
function Quotient()
function OnRequestComplete(result)
</script>
<body>
<form id="form1" runat="server">
<asp:scriptmanager ID="Scriptmanager1" runat="server">
<Services>
<asp:ServiceReference Path="MyService.asmx"/>
</Services>
</asp:scriptmanager>
<table border="0" cellspacing="3" bgcolor="#898989">
<tr bgcolor="#e9e9e9">
<td>
<input type="text" id="input1" size="20" /></td>
<td align="center">
+</td>
<td>
<input type="text" id="input2" size="20" /></td>
<td style="width: 25px">
<input id="button1" type="button" value="和" onclick="return Sum()" /></td>
<td rowspan="4" style="width: 25px"> <label id="Flag" style="color:Red;"></label>
</td>
</tr>
<tr bgcolor="#e9e9e9">
<td>
<input type="text" id="input3" size="20" /></td>
<td align="center">
-</td>
<td>
<input type="text" id="input4" size="20" /></td>
<td style="width: 25px"> <input id="button2" type="button" value="减" onclick="return Diff()" />
</td>
</tr>
<tr bgcolor="#e9e9e9">
<td>
<input type="text" id="input5" size="20" /></td>
<td align="center">
*</td>
<td>
<input type="text" id="input6" size="20" /></td>
<td style="width: 25px"><input id="button3" type="button" value="乘" onclick="return Mul()" />
</td>
</tr>
<tr bgcolor="#e9e9e9">
<td>
<input type="text" id="input7" size="20" /></td>
<td align="center">
/</td>
<td>
<input type="text" id="input8" size="20" /></td>
<td style="width: 25px"><input id="button4" type="button" value="除" onclick="return Quotient()" />
</td>
</tr>
</table>
</form>
</body>
</html>
效果:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<script type="text/javascript" language="JavaScript">
function Sum()
function Diff()
function Mul()
function Quotient()
function OnRequestComplete(result)
</script>
<body>
<form id="form1" runat="server">
<asp:scriptmanager ID="Scriptmanager1" runat="server">
<Services>
<asp:ServiceReference Path="MyService.asmx"/>
</Services>
</asp:scriptmanager>
<table border="0" cellspacing="3" bgcolor="#898989">
<tr bgcolor="#e9e9e9">
<td>
<input type="text" id="input1" size="20" /></td>
<td align="center">
+</td>
<td>
<input type="text" id="input2" size="20" /></td>
<td style="width: 25px">
<input id="button1" type="button" value="和" onclick="return Sum()" /></td>
<td rowspan="4" style="width: 25px"> <label id="Flag" style="color:Red;"></label>
</td>
</tr>
<tr bgcolor="#e9e9e9">
<td>
<input type="text" id="input3" size="20" /></td>
<td align="center">
-</td>
<td>
<input type="text" id="input4" size="20" /></td>
<td style="width: 25px"> <input id="button2" type="button" value="减" onclick="return Diff()" />
</td>
</tr>
<tr bgcolor="#e9e9e9">
<td>
<input type="text" id="input5" size="20" /></td>
<td align="center">
*</td>
<td>
<input type="text" id="input6" size="20" /></td>
<td style="width: 25px"><input id="button3" type="button" value="乘" onclick="return Mul()" />
</td>
</tr>
<tr bgcolor="#e9e9e9">
<td>
<input type="text" id="input7" size="20" /></td>
<td align="center">
/</td>
<td>
<input type="text" id="input8" size="20" /></td>
<td style="width: 25px"><input id="button4" type="button" value="除" onclick="return Quotient()" />
</td>
</tr>
</table>
</form>
</body>
</html>
using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; [Microsoft.Web.Script.Services.ScriptService]
相关文章推荐
- 研究Ajax(二)WebService实现加 减 乘 除
- ajax跨域调用webservice的实现代码
- 利用JQuery jsonp实现Ajax跨域请求 .Net 的*.handler 和 WebService,返回json数据
- AJAX和WebService实现省市县三级联动
- 关于js实现的Ajax调用,webService,一般处理程序,aspx
- 使用jQuery Ajax 请求webservice来实现更简练的Ajax
- 利用JQuery jsonp实现Ajax跨域请求 .Net 的*.handler 和 WebService,返回json数据
- 使用 XMLHttpRequest 实现 Ajax 四:调用 Webservice
- AJAX之旅(2):javascript中类的深入研究-实现和继承
- AJAX和WebService实现邮箱验证(无刷新验证邮件地址是否合法)
- AJAX和WebService实现邮箱验证(无刷新)
- Ajax调用webservice实现RadiobuttonList 和DorpDownList联动
- 使用Jquery Ajax的webservice请求来实现更简练的Ajax
- 用Dojo实现Ajax请求:XH“.NET研究”R、跨域、及其他
- 使用WC“.NET研究”F实现SOA面向服务编程——使用AJAX+WCF服务页面开发
- 利用JQuery jsonp实现Ajax跨域请求 .Net 的*.handler 和 WebService,返回json数据
- JavaWeb开发中Ajax技术、json与java实现List、Map数据直接传递的研究
- 使用Jquery Ajax的webservice请求来实现更简练的Ajax
- ajax 笔记--调用WebService实现求两数之和