I have serached on the internet,I found the links but none of them provide me the solutions.
One of the sites from that I refer-
http://sappidireddy.wordpress.com/2008/03/...in-aspnet-ajax/
Code-Behind Page
public partial class _Default : System.Web.UI.Page
{
[System.Web.Services.WebMethod]
public static int AddTwoNumbers(Int32 a)
{
int addtion = a + a;
return addtion;
}
}
Source Tab
<%@ 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>Untitled Page</title>
<script type ="text/javascript" language ="javascript" src ="JScript.js">
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"/>
</div>
<table>
<tr>
<td style="width: 100px">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
</table>
</form>
</body>
</html>
JS File
function sum(int a)
{
// call server side method
pagemethods.AddTwoNumbers(a);
}
Errors1) Unknown server tag 'asp:ScriptManager'.
2)Element 'ScriptManager' is not a known element. This can occur if there is a compilation error in the Web site.
Plz help me out.