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 3454626
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:30:56+00:00 2026-05-18T09:30:56+00:00

I’m currently working on a ASP.NET Webforms site and I’ve run in to a

  • 0

I’m currently working on a ASP.NET Webforms site and I’ve run in to a small problem. Been searching around for 2 hours now and I got a deadline, so hoping someone here can assist.

On my .cs file I have the following Webmethod

[WebMethod]
   public static string IsJobEditable(int jobid)
   {
       try
       {
           string isEditable = "false";

           JobsBLL jbl = new JobsBLL();

           int jobStatusId = jbl.GetJobStatusId(jobid);


           if(jobStatusId == Convert.ToInt32(ConstantsUtil.JobStatus.Waiting) || jobStatusId == Convert.ToInt32(ConstantsUtil.JobStatus.Edit))
           {
               isEditable = "true";
           }

           return isEditable;


       }
       catch (Exception ex)
       {

           throw ex;
       }
   }

This function in this case will ALWAYS return TRUE as a string.

On Aspx page I have the following

$(function () {

           $.ajax({

               type: "POST",
               url: "Coordination.aspx/IsJobEditable",
               data: "{jobid:" + jobid + "}",
               contentType: "application/json; charset=utf-8",
               dataType: "text",
               success: function (result) {

                   alert(result);


                   // This is written out in the alert {"d":"true"}
                   // I want this in a variable as a string
                   // so I can do a check on it before I do some other actions
                   // The format is not a String so i cannot split on it to 
                   // retrieve the "true" part.

               },
               error: function (err, result) { alert(err); }

           });
       });

As you can see in the comments the value I get back in the Callback method is in to me a weird format. The type is unknown and I need this value to be able to proceed with my entire method surrounding the small portion of the Javascript.

So can anyone point me into the direction where I can access the result variable / data as a var or anything else that will let me put it into a var (as a string).

  • 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-18T09:30:57+00:00Added an answer on May 18, 2026 at 9:30 am

    This solved it:

    $(function () {
    
           $.ajax({
    
               type: "POST",
               url: "Coordination.aspx/IsJobEditable",
               data: "{jobid:" + jobid + "}",
               contentType: "application/json; charset=utf-8",
               dataType: "json",
               success: function (result) {
    
                   alert(result.d);
    
                   //I finally got the data string i wanted
                   var resultAsString = result.d;
    
               },
               error: function (err, result) { alert(err); }
    
           });
       });
    

    So 2 things were done to solve this. I had to change the dataType to “json” and I used the result.d to retrieve my data.

    What threw me off was the lack of intellisens on the result object. But the .d (data) property however solved it.

    Thanks you to all who contributed to this answer.

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

Sidebar

Related Questions

No related questions found

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.