Step : Calling this service from another location. Create a new
website elsewhere in the net work or as a new application
http://manas6/aspnet.35/WebServices2Client/Default.aspx

Add a web reference ( using
http://manas6/aspnet.35/WebServices2/AddupService.asmx?wsdl )

Watch the service is found and now add to your solution explorer,
clicking add-reference

Now the the class and web method in the web service would be
accessible to the client. Few years ago, webservice.htc allowed the
developer to use JavaScript from an web page to consume the web
services; but I found that it had been archived.

Code in Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div align="center" style="width: 520px">
Enter two numbers<br />
<asp:TextBox ID="T1" runat="server" Height="20px" Width="74px"></asp:TextBox> 
 
<asp:TextBox ID="T2" runat="server" Height="20px" Width="96px"></asp:TextBox><br
/>
<asp:Button ID="Button1" runat="server" Height="28px"
Text="Calculate "
Width="133px" onclick="Button1_Click" /><br />Results:
<asp:Label ID="L1" runat="server" Text=""></asp:Label>
</div>
</form>
</body>
</html>
Code in Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
int n1 = Convert.ToInt32(T1.Text);
int n2 = Convert.ToInt32(T2.Text);
manas6.AddupService addNum = new manas6.AddupService();
L1.Text =" The total is " + addNum.AddNumber(n1, n2).ToString();
}
}