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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:50:20+00:00 2026-05-29T23:50:20+00:00

When I get referrer url, IIS 7 throws an exception. My code like this:

  • 0

When I get referrer url, IIS 7 throws an exception. My code like this:

var referrer = Request.UrlReferrer == null ? null : Request.UrlReferrer.AbsoluteUri;

Application throws an ArgumentException with error message,

“Value does not fall within the expected range.”

There is no problem in IIS 6.

This exception occurs when the page is navigated with “Response.Redirect”

Application main page has an Response.Redirect method according to role of current user. User main page throws this exception.

How can get Referrer URL in IIS 7.

Thanks,

  • 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-29T23:50:24+00:00Added an answer on May 29, 2026 at 11:50 pm

    Ran into similar problem when I tried to access the request object from a System.Threading.Task launched in the request processing.
    I’m using the task to reduce response time – in my case most of the processing can be performed after request is sent.
    That is, I had something like:

    public ActionResult SomeAction()
    {
        new System.Threading.Task(() => {
    
            // here I used this.Request.UrlReferrer and got weird ArgumenException error
    
        }).Start();
    
        return someActionResultThatDoesntRequireProcessing;
    }
    

    I’ve extracted UrlReferrer (and other this.Request.stuff that I needed) in delayed processing) into a separate “closure” variable (I’ve chosen them to have the very basic types):

    public ActionResult SomeAction()
    {
        var urlReferrerAbs = this.Request.UrlReferrer.AbsoluteUri;
        var clientAddress = this.Request.UserHostAddress;
        // save other stuff from the request object
    
        new System.Threading.Task(() => {
    
            // here I used urlReferrerAbs instead of this.Request.UrlReferrer and the error has gone!
    
        }).Start();
    
        return someActionResultThatDoesntRequireProcessing;
    }
    

    That worked for me.

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

Sidebar

Related Questions

I use this code to get referer url: <?php echo $_SERVER['HTTP_REFERER']; ?> And the
By using document.referrer we will get all the reference of URL in JavaScript, such
How do I get the referrer URL in an ASP.NET MVC action? I am
I am trying to get the search keyword from a referrer url. Currently, I
I have a some code that embeds a return_to URL into a redirect (like
How can I get the complete url like http://twitter.com/#!/larrickchen using something like document.refrerrer if
UPDATE: Let me specify a few things. This GET request (to another domain )
I am using javascript to get the referring page (document.referrer) which works fine and
We get the following error; The request was aborted: Could not create SSL/TLS secure
I get a URL from a user. I need to know: a) is the

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.