Click here to Skip to main content
12,696,092 members (30,499 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Javascript Ajax jQuery
hi, I wanna know how can I receive the parameter that I send via ajax in the c# classe to insert in the database, here´s the javascript code:

            type: 'POST',
            url: 'new_circle.aspx/insertCirclePeople',

            data: "code=" + $('#txtcode').val(),
            statusCode: {
                404: function () {
                    alert('Page not found');
                500: function () {
                    alert('Server error');
            success: function (data) {
Posted 13-Dec-12 11:03am
Member 9581488 13-Dec-12 16:15pm
Create Json object in insertCirclePeople method. Return json on success and you can grab that Json obj in your success function in AJAX.
vanilsonwdd 13-Dec-12 16:31pm
What about the code in the c# class? How I´m gonna receive the value that I send to the send using json? I´m new in, the json in the javascript isn´t the problem, my problem is in the c# class
Member 9581488 13-Dec-12 16:37pm
Use json Desearialize to Get obj value.
Please refer following link
Sergey Alexandrovich Kryukov 13-Dec-12 16:38pm
How is this related to C# class? :-)

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

In MVC you can just make the parameters parameters in your method that you call. In straight ASP.NET, I'd put them on the URL you call and get them from there

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100