I m using jquery with json webservice calling please see attached file for code..
so when i call Recordtest web method on button click ..It gives error message as "Internal server error"
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
erum mirzaRank #3,517 · 413 reputationPosted Dec 28, 2012, 12:38 AM EST
using
System;using
System.Collections.Generic;using
System.Linq;using
System.Web;using
System.Data;using
System.Web.Services;using
System.Web.Script.Services;namespace
{
JQueryAjax///
/// Summary description for MyService
///[
[
[System.ComponentModel.
WebService(Namespace = "http://tempuri.org/")]WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]ToolboxItem(false)]// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.[System.Web.Script.Services.
ScriptService]public class MyService : System.Web.Services.WebService{
[
[
{
System.Threading.
}
[
[
{
}
[
[
{
WebMethod]ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string HelloWorld()Thread.Sleep(1000);return "Hello World";WebMethod]ScriptMethod(ResponseFormat = ResponseFormat.Json)] public int Add(int value1, int value2)return value1 + value2;WebMethod]ScriptMethod(ResponseFormat = ResponseFormat.Json)]public string RecordsTest(string loginid, string pass)//if (loginid == "Admin")
//{
// return "Exist";
//}
return "";//else
//{
// return "Not Exist";
//}
//DataTable dt = new DataTable("MyDataTable");
//dt.Columns.Add("column1", typeof(System.String));
//dt.Columns.Add("column2", typeof(System.String));
//DataRow dr = dt.NewRow();
//dr["column1"] = "Your Data";
//dr["column2"] = "Your Data";
//dt.Rows.Add(dr);
//dr = dt.NewRow();
//dr["column1"] = "Your Data";
//dr["column2"] = "Your Data";
//dt.Rows.Add(dr);
//return dt;}
}
}
erum mirzaRank #3,517 · 413 reputationPosted Dec 28, 2012, 12:39 AM EST