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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:34:19+00:00 2026-06-04T16:34:19+00:00

Using MVC 3, a user gets to a URL like app/Controller/Details/123 An $.ajax request

  • 0

Using MVC 3, a user gets to a URL like app/Controller/Details/123

An $.ajax request on the page posts back to /Controller/AnotherAction.

Inside AnotherAction, I want to get the IDNumber seen in the browser…

I’ve tried looking at the Request object but they all return Controller/AnotherAction:

HttpContext.Request.Path, 
HttpContext.Request.Url.AbsolutePath,
HttpContext.Request.RawUrl,
HttpContext.Request.Url.ToString()

Is there any way to get the ID number from Details that the browser is seeing?

  • 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-04T16:34:20+00:00Added an answer on June 4, 2026 at 4:34 pm

    If you are checking it in the action method which is being invoked by your ajax call, All those Request Properties will give you the information about your current Ajax request. Not the one you have in your address bar.

    You need to exclusively pass the relevant IDs / key as parameters of the action method and use those.

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

Sidebar

Related Questions

if i call a ajax request using jquery to an asp.net mvc controller action
I have a following table using MVC that shows number of items the user
We are building a site using asp.net mvc. We want to allow the user
Using a Telerik Grid with ASP.NET MVC 3 Razor engine. When a user selects
For an ASP.NET MVC 2 application, we are using HttpContext.User.Identity.Name to get the user
I'm using MVC with /<module>/<controller>/<action>/ have a module at example.com/module/whatever, and I need to
I'm using jQuery in my ASP.NET MVC 2 page. It's a super simple post
I am using asp.net mvc, C# and jquery. My site is uses ajax heavily.
I'm working on MVC project and i using jQuery in view page to get
Let me explain my situation: I'm using a MVC framework (CodeIgniter), so every request

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.