Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6243729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:11:48+00:00 2026-05-24T12:11:48+00:00

hello i have a litel problem i try to call a function in c#

  • 0

hello i have a litel problem i try to call a function in c# throw ajax but it dosen’t work i try evrey thing but still nothing can some one plz tell me what’s wrong

function Save(ID, FullId) {
var code ="1234"// prompt("הכנס סיסמא", "סיסמא");
var flag = 2;//subcatgory
var catname='';
if (code == "1234") {
    if (FullId == "tdcatid" + ID){
        flag = 1; //catgory

        }
        catname=$('#'+FullId).val();
        $.ajax({
            async: false,
            type: "POST",
            url: "admins.aspx/SaveCondition",
            data: '{catId: ' + ID + ',catFlag:' + flag + ',catName: ' + catname + '}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                alert(response.d);
            }

        });

sever side

 [System.Web.Services.WebMethod]
public static int SaveCondition(int catId, int catFlag, string catName)
{
   int answer=(int) Dbhelper.ExecuteScalar("server=MY_COMP\\AMIT;database=IDEAS;Trusted_Connection=True",
        "sp_save_catgory_and_sub",
        new SqlParameter("@caname", catName),
        new SqlParameter("@catid", catId),
        new SqlParameter("@flag", catFlag)
        );
   return answer;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:11:49+00:00Added an answer on May 24, 2026 at 12:11 pm

    I think you may be missing some quotes around your data parameters and the framework cannot deserialize the json object correctly (ie. to the types on your signature):

    data: '{catId: "' + ID + '",catFlag:"' + flag + '",catName: "' + catname + '"}',
    

    (you just really need them around the string parameter catname…)

    also, it may be that you pasted just part of your code, but you’re missing closing brackets at the and (2)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i have just started learning mvc2 and im having a problem with the
Hello I have a bizarre problem with sprintf . Here's my code: void draw_number(int
hello i have a problem i am trying to convert a string like 12314234
Hello I have a Problem with some Buttons I would like to create a
Hello I have a class with a function that returns a pointer: int* Maze::GetStart()
Hello I have following Problem: Within an uninstall-process I load a JAR (jdbc-driver). URL
Hello I have a problem with a binding that I want to do and
Hello I have very strange problem and maybe some of you could help my.
Hello I have a php code which by echo calls the javascript function expand(txt)
Hello guys i have a problem streaming PDF files with php, i'm using this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.