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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:41:56+00:00 2026-06-11T15:41:56+00:00

Assuming that I’m talking about an ASP.NET MVC 3 application, the scenario is something

  • 0

Assuming that I’m talking about an ASP.NET MVC 3 application, the scenario is something like

  1. I browse to the URL http://localhost:60088/Example?param1=test123 that returns a view
  2. Next I click a button that triggers an Ajax call to the URL http://localhost:60088/Example/DoSomethign that returns a JSON string

So, my dilemma is that in the DoSomething controller action I need to get the param1 parameter that was passed in the first step.

My first take is to do something like this:

public ActionResult DoSomething()
{
    ...

    Uri baseUrl = this.Request.UrlReferrer;
    // Somehow extract the parameter from baseUrl

    ...
}

But I’m not sure if that’s a good idea at all…

Questions:

  1. Is safe to assume that this.Request.UrlReferrer will always have the URL that was called in a non-callback way (even if I made several more callbaks after the _DoSomething_ first callback)?

  2. Is there a better way to accomplish waht I’m trying to do?

  • 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-11T15:41:57+00:00Added an answer on June 11, 2026 at 3:41 pm

    No; you cannot assume that the referrer will always exist.

    Instead, you should include the original URL as a parameter in the AJAX request.

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

Sidebar

Related Questions

Assuming that an ASP.NET MVC View is going to show data, is there any
Assuming that I must deploy an asp.net app over the following 3 servers: 1)
Assuming that T is an arbitrary type and we're talking about Objective-C. Then what
assuming that I know nothing about everything and that I'm starting in programming TODAY
Assuming that I created a cloud-based website application that people literally all over the
Assuming that I have an variable like: int n = 23; it is possible
Assuming that a C# program uses only managed .NET code, is it possible to
Assuming that I have a class named Class , And I would like to
Assuming that: The C# source code below is compiled under .NET 2.0 (CLR 2.0);
Assuming that I have a basic enum like: public enum Color { Red, Green,

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.