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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:36:09+00:00 2026-05-31T13:36:09+00:00

I have an ASP.NET Web Forms application and on one of my .ASPX pages

  • 0

I have an ASP.NET Web Forms application and on one of my .ASPX pages I have some javascript.

In one part of the Javascript, I want to call a web service so I can perform a server-side function and return either a true or false value, then in the javascript I can perform one of two actions depending on the true or false value.

I’ve not done any web services before and so I’m struggling with getting a simple value back to the JS.

My WebService (LoginCheck.asmx) currently looks something like this:

[System.Web.Script.Services.ScriptService]
public class LoginCheck : System.Web.Services.WebService
{
    [WebMethod]
    public bool IsLoggedIn()
    {
        return UserService.IsAuthenticated();
    }
}

My Javascript call currently looks something like this:

$.ajax({
    type: "GET",
    contentType: "application/json; charset=utf-8",
    url: "LoginCheck.asmx/IsLoggedIn",
    data: "{}",
    dataType: "json",
    success: function (response) {
        if (response) {
            alert('Logged in: true');
        } else {
            alert('Logged in: false');
        }
    }
});

Despite having a breakpoint in my code on the ‘IsLoggedIn’ web service method, it never breaks on it. I have checked the ‘console’ in Google Chrome when the web service is supposed to be called and it says something along the lines of:

“The following operations are supported…”, and it shows my one ‘IsLoggedIn’ method, but all the content rendered in this console window is essentially an HTML page, with HTML markup.

I don’t appear to ever be a) breaking on the breakpoint in code or b) getting a response back to my javascript (hence neither of the js alerts shown in my code above are occurring).

  • 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-31T13:36:10+00:00Added an answer on May 31, 2026 at 1:36 pm

    it’s getting a 301 redirect back to the LoginCheck.asmx

    I got the same problem today.

    You are probably using a LowerCaseRule in the URLRewrite 2 module for IIS.
    Your method name is IsLoggedIn, so the LowerCaseRule tries to call isloggedin, which fails.

    Your LowerCaseRule should ignore asmx files, like this:

            <rule name="LowerCaseRule1" stopProcessing="true">
                <match url="[A-Z]" ignoreCase="false" />
                <conditions>
                    <add input="{URL}" matchType="Pattern" pattern="^.+\.((axd)|(js)|(xaml)|(asmx))$" ignoreCase="true" negate="true"/>
                </conditions>
                <action type="Redirect" url="{ToLower:{URL}}" />
            </rule>
    

    Edit: I summed some of today’s experience up and posted it here: http://www.tomot.de/en-us/article/8/asp.net/how-to-use-jquery-to-call-a-webservice-asmx-method

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

Sidebar

Related Questions

I have a ASP.NET Web Forms application and I'm using some dynamic controls in
I have developed a web application (ASP.NET Web Forms). One of my customer has
I have an ASP.NET web application that is using forms authentication. Everything is configured
I have installed an ASP.NET 4.0 Web forms application in IIS 7.5. If I
I am migrating an application from ASP.NET Web Forms to ASP.NET MVC 3. One
I have an ASP.NET web application that takes user input across several forms. Sort
I have developed an ASP.NET chat application. Now I want some integration with my
I have an ASP.NET Web Forms application. In my application I have a GridView
My team and I have a asp.net web forms application and are using several
Im working on an ASP.Net web forms application, where I have a form and

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.