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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:32:33+00:00 2026-06-02T14:32:33+00:00

I have created an android application using (Jquery & PhoneGap). The application works fine

  • 0

I have created an android application using (Jquery & PhoneGap). The application works fine Now, I want to retrieve data from my ASP.NET Web Service.

html:

<html>
<head>
    <meta charset="utf-8">
    <title>My Friends</title>

    <link href="Jquery-mobile/jquery.mobile-1.1.0.css" rel="stylesheet" type="text/css" />
    <script src="Jquery-mobile/jquery-1.4.1.js" type="text/javascript"></script>

    <script src="Jquery-mobile/jquery.mobile-1.1.0.js" type="text/javascript"></script>
     <script type="text/javascript">


        $(function(){
             //code to fetch data from webservice  

             alert($("#test").html());
        });
    </script>

  </head>
  <body>
</body>
</html>

asp.net web service

/// <summary>
    /// Summary description for WebService1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 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 WebService1 : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
    }
  • 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-06-02T14:32:35+00:00Added an answer on June 2, 2026 at 2:32 pm

    First uncomment the following line in the service

        .....
        // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    
        [System.Web.Script.Services.ScriptService] 
        // uncomment this ^ ^
        public class WebService1 : System.Web.Services.WebService
        {
        .....
    

    To call the hello world method use jQuery.ajax

    $.ajax({
      type: "POST",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      url: "WebService1.asmx/HelloWorld",
      data: "{}",
      success: function(msg){
          $("body").append(msg.d); //will append "Hello world" to body tag
      },
      error: function () {
    
      }
    });
    

    I would recommend you to us WCF REST services instead

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

Sidebar

Related Questions

I have created a Android application using Google Maps. Now I want to check
I am developing application using phonegap in eclipse for android .I have created folder
I have created a button in my Android application & I tried to set
I have created a database for my application. Now I want to make sure
I have an application that is using jquery, jquerymobile and spine.js running on phonegap
I have created a drop down in my android application using a spinner. However
I have created an android application using eclipse, but when i run it, i
Hello i have created a sample application in android using eclipse IDE my code
I have created an application in Android for RabbitMQ using RabbitMQ-Android tutorial. It is
I have a problem regarding Android App. I have created an application that download

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.