in this program, getting either output nor error.
so please check whether function ClassAdd() has any error.
Also note that I am getting result in another way( see in the last part of this post)
.aspx code:-
webService.cs:- [WebMethod] public void ClassAdd(string a, int b) { ClassSP spClass = new ClassSP(); ClassInfo InfoClass = new ClassInfo(); InfoClass.className = a; InfoClass.Seats = b; spClass.classAdd(InfoClass); } I am getting result and data is being inserted to the database with the help of WebService. I put break point in the ClassAdd() function in WebService.cs file. And here the happenings after i press F10:- When click on ClassAdd:- And I am getting this when I press Invoke button:- And then I am getting the Message:-"Saved Sucessfully" The window below not giving me the output:- So please give me the cause to these functions. 4 RepliesKnow the answer? Post it — somebody with the same question will find it here. Sign in to answer this question It is the same account you read, post and publish with — and you will come straight back to this page. |

Bineesh ViswanathPosted Sep 6, 2013, 5:28 AM
I want to do the ClassAdd() function through the .aspx.
Mr. Sanjeeb, I added the code you gave, but still no improvement to the program.
here the WebService.cs code:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
///
/// Summary description for WebService
///
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// 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 WebService : System.Web.Services.WebService {
public WebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public void ClassAdd(string a, int b)
{
ClassSP spClass = new ClassSP();
ClassInfo InfoClass = new ClassInfo();
InfoClass.className = a;
InfoClass.Seats = b;
spClass.classAdd(InfoClass);
}
}
And Webservice.asmx code:-
<%@ WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" Class="WebService" %>
Sanjeeb LenkaPosted Sep 6, 2013, 4:51 AM
try this:
in button:
if any problem plz put a break poin in webservice method and check its going to that or not. if not share your full webservice .cs code.
Bineesh ViswanathPosted Sep 6, 2013, 3:48 AM
But I need the function through JQuery.
Here My JQuery for Save() function:-