| | |
Calling C# From JS
![]() |
•
•
Join Date: Mar 2008
Posts: 327
Reputation:
Solved Threads: 7
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/20...n-aspnet-ajax/
Code-Behind Page
Source Tab
JS File
Errors[color=#CC0000]1) Unknown server tag 'asp
criptManager'.
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.
One of the sites from that I refer-
http://sappidireddy.wordpress.com/20...n-aspnet-ajax/
Code-Behind Page
C# Syntax (Toggle Plain Text)
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
C# Syntax (Toggle Plain Text)
<%@ 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
C# Syntax (Toggle Plain Text)
function sum(int a) { // call server side method pagemethods.AddTwoNumbers(a); }
Errors[color=#CC0000]1) Unknown server tag 'asp
criptManager'.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.
Freedom in the Mind, Faith in the words.. Pride in our Souls...
Indian Developer
http://falaque.wordpress.com/
Indian Developer
http://falaque.wordpress.com/
![]() |
Similar Threads
- Calling external files (C++)
- Having trouble calling certain functions (C++)
- performance benefit by not calling static member function by object (C)
- calling a SQL UDF? (PHP)
- how to simultaneously run 2 programs by calling one from another (C)
- Still need info on calling a function from bool! (C++)
- calling methods. (Java)
- Calling Oracle Stored Procedures with ASP (ASP)
Other Threads in the C# Forum
- Previous Thread: how to import data from excel sheets in c#
- Next Thread: Trouble with my IDE. Combobox datasource issue.
Views: 818 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C#
.net 2d access algorithm application array asp.net audio automation bitmap box broadcast button c# calendar call chat check checkbox class code color control conversion csharp custom database datagrid datagridview dataset datetime degrees deployment display dll drawing event excel file form format forms function game gcd gdi+ graphics image index input internet label list listbox login math multithreading mysql networking office operator pda photoshop php picturebox pixel prime print procedure programming recursion remote remoting resource saving search server sleep socket sql start statistics stream string tcp text textbox threading time timer update validation vc++ view visual webbrowser windows winforms wpf xml






