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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:46:45+00:00 2026-05-31T19:46:45+00:00

OK, so my websites been working normally up until now, I’m not really sure

  • 0

OK, so my websites been working normally up until now, I’m not really sure what I’ve changed. I have a jQuery AJAX call that sends a coupon code to the server, and retrieves a number (which is the discount).

The Webmethod is no longer being fired though, instead the Page_load of the page which the webmethod is on is being fired. Why? What can I check? What can I do?

Here is my handler for when the button is clicked

$('div#code_apply_btn').click(function() {
    $(this).html('PLEASE WAIT');
    getpromocode();
});

Here is the AJAX call

function getpromocode(){
    var pcode = $('input#input_circuitcode').val();
    var hid = parseInt($('input#ss_id_h').val());
    $.ajax({
        type: "POST",
        url: "register.aspx/get_promocode",
        data: '{"promo":"' + pcode + '", "uid":' + hid + '}',
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (msg) {
            if (msg.d != -1) {
                applydiscount(msg.d);
                $('div#reg_circuit').show();
                $('div#circuit_promo').hide();
                $('div#reg_circuit').click();
            }
            else {
                $('input#input_circuitcode').val('');
                $('div#code_apply_btn').html('APPLY CODE');
            }
        },
        error: function (msg) {
            alert(msg);
        }
    });
}

Here’s the webmethod

[WebMethod]
public static int get_promocode(string promo, int uid)
{
    return DAC.GetPromoCode(promo);
}

The webmethod is never called, but the Page_load event fires and runs through everything then it gets a 500 error because it shouldn’t be called and doesn’t have all the data it needs.

EDIT:

All my other pages that are using web methods work fine. It’s just this page.

Another bit of strange behaviour: In chrome as soon as I begin to type “register.aspx”, the Page_load is called. Again all my other pages are fine and this doesn’t happen.

  • 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-31T19:46:47+00:00Added an answer on May 31, 2026 at 7:46 pm

    I have found the answer to my question:

    Because I have VS2008 I can only use .Net 3.5. My server however has .Net 4.0 or 2.0 for whatever reason I can’t choose 3.5 as I would have liked to. So everytime I move my project I have to change the web.config because the default 3.5 config is filled with a whole bunch of stuff that 4.0 doesn’t like.

    So I remembered that I had emptied out the web.config to a barebone version that still worked in 3.5 which is where the problem is. I narrowed it down to these lines which I had excluded from the version running locally on 3.5

    <httpModules>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, 
            System.Web.Extensions, Version=3.5.0.0, Culture=neutral, 
            PublicKeyToken=31BF3856AD364E35"/>
    </httpModules>
    

    I guess the script module is what passes your jQuery requests to the web methods rather than the default page handler. There you go.. But no obvious errors or anything, it just didn’t work.

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

Sidebar

Related Questions

I have been working with an existing website out company has running until I
I've been working websites for 15 years. PHP/mySQL for about 8. I'm not even
I have been doing some performance analysis on a few websites I am working
I have been working with Ruby on Rails for over a year now and
I have been creating and working on different websites. Many a times a get
I have been trying forever but it is just not working, how can I
I have been working with managing agile teams for quite some time. Now I'm
I've been looking on many websites now for the answer, but all working answers
I have been working on a website that has some images that I need
So I have been working with javascript for a website I am designing, shocker

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.