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

  • Home
  • SEARCH
  • 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 6135235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:27:16+00:00 2026-05-23T17:27:16+00:00

Experts, The following function are successfully send data to the Controller.cs (server) var ajaxResponse

  • 0

Experts,

The following function are successfully send data to the Controller.cs (server)

 var ajaxResponse = $.ajax({
                        type: "post",
                        url: href,
                        dataType: 'json',
                        contentType: "application/json; charset=utf-8",
                        data: JSON.stringify(postData),
                        success: function (msg) {
                           alert("Success");
                        }
                    })

but i am not able to get updated status from the following method

[AcceptVerbs(HttpVerbs.Post)]
        public ActionResult SaveData(TabMasterViewModel postData)
        {
            string message = "";
            try
            {
                TabMasterViewModel update = new TabMasterViewModel();
                update = _tabmasterService.GetSingle(r => r.colID == postData.colID);
                UpdateModel(update);
                _tabmasterService.Update(update);
                message = "Success";
            }
            catch (Exception e)
            {
                message = e.Message;
            }
            return Content(message);
        }

I would like to display message when failed or success. this following line never execute

success: function (msg) {
                           alert("Success");
                        }

but my server side code is executed without any error.

Please provide your valuable suggestions,

Thanks,
Imdadhusen

  • 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-23T17:27:18+00:00Added an answer on May 23, 2026 at 5:27 pm

    Instead of returning ActionResult you should be returning JsonResult

    For example

    public JsonResult SaveData() {
      return Json(new {success=true, msg="Saved ok"});
    }
    

    then your JS

    success: function (msg) {
                                if(msg.success)
                                   alert("Success");
                            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a custom taxonomy and a custom post type: <?php function my_custom_taxonomies() {
I keep getting the following errors: /private/var/tmp/phpl3E3lq Warning: imagecreatefromjpeg(/private/var/tmp/phpl3E3lq) [function.imagecreatefromjpeg]: failed to open stream:
I have the following two Node.js files: //test.js var hash=require('./hash'); var sys=require('sys'); hash.hash(asdf,function(param){ sys.puts(param);
I have the following method in a CI model: function getPostTitle($post_slug) { global $post;
I have a Delphi 7 dll that exports the following function: function StringTest(var StringOut
The getStockValue() function is called from another javascript file in the following way: var
Apologies if the question sounds silly, I was following experts in SO and trying
Experts - I need some advice in the following scenario. I have a configuration
SQL Experts, Is there an efficient way to group runs of data together using
If I define the following function which expects a Long, and I define the

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.