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

The Archive Base Latest Questions

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

If from the page localhost:nnnn/Class I click on an AJAX link that will post

  • 0

If from the page localhost:nnnn/Class I click on an AJAX link that will post to ‘Class/AddClass’ I get a RawUrl of Class/AddClass and it works just fine.

If from the page localhost:nnnn/Class/Index I click the same link I get a RawUrl of Class/Class/AddClass and it (obviously) doesn’t work.

I realize I’m in Routing Hell, but who’s rewriting the URL and why? I painstakingly stepped through the jQuery code and indeed it’s posting to Class/AddClass.

Thanks for insight…
Eric

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

    It is not rewriting that is the problem. Your AJAX request is JavaScript and has nothing to do with the ASP.NET routing engine. When you use Class/AddClass you are making it relative to the location of the current URL. You can use /Class/AddClass which will resolve to the root of the site. That poses an issue if you are even in a virtual directory. I prefer to pull the full URL from a configuration file:

    var url = '<%: ConfigurationManager.AppSettings["WebsiteURL"] %>/Class/AddClass';
    

    With the appropriate entry in the web.config. This eliminates any guess work. You can also use ResolveUrl:

    var url = '<%: ResolveUrl("/Class/AddClass") %>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanna get the Timedate value from another page using request.querystring and then use
Does anybody know how to redirect parent page from an ajax call? I made
I am export pdf from my php page to 'pdf' in my localhost by
I am exporting data from php page to word,, there i get 'n' number
I have a very simple class using HttpListener to receive an HTTP POST from
i have this textarea, that takes the value of a get function transferred from
I couldn't get the POST value in servlet page. my previous question related to
I am making a dynamic web page that allows people to post their favorite
I have this query: SELECT page.id, revision.title, revision.number FROM page INNER JOIN revision ON
What's the best way to authenticate and track user authentication state from page to

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.