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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:13:20+00:00 2026-05-28T06:13:20+00:00

I have this following code: if (Request.UrlReferrer != null) { if (Request.UrlReferrer.PathAndQuery.ToLowerInvariant() == /test/content.htm)

  • 0

I have this following code:

if (Request.UrlReferrer != null)
        {
            if (Request.UrlReferrer.PathAndQuery.ToLowerInvariant() == "/test/content.htm")
            {
                postbacklink = Request.UrlReferrer.AbsoluteUri.Replace("/TEST/Content.htm", "/Testing.aspx?")  + Request.QueryString;
            }
            else
            {
                postbacklink = Request.UrlReferrer.AbsoluteUri;
            }
        }
        ExtendedLoanView.PostbackLink = postbacklink;

Now this page can be accessed by two different locations. Which means this code:

 postbacklink = Request.UrlReferrer.AbsoluteUri.Replace("/TEST/Content.htm", "/Test.aspx?")  + Request.QueryString;

can only work with one page (Test.aspx) and is hard coded. So in IE7 Request.UrlReferrer shows me this:

Request.UrlReferrer = {http://Testing:12345/PPP/Content.htm}

Whereas in IE8+ I am getting this value:

Request.UrlReferrer = {http://Testing:12345/PPP/TestingPage.aspx?Name=Xyz&Address=123 YYY

How should I solve this issue? Its been bugging me for past month.

  • 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-28T06:13:21+00:00Added an answer on May 28, 2026 at 6:13 am

    I would definitely advice not to base your logic on request information (not anymore than user entered values). The thing is that it will be different across browsers, and it is really hackable.

    If you still need to pass information from client to server, make sure to have those validated. If you need those to stay in sync and have valid information, do not rely on what the browsers give you, but set it yourself and then take it from a place in the request you did set (for example, a hidden input, a control, a variable on the viewstate, or whatever allows the technology you’re using).

    Most sites handle the situation you’re trying to solve by passing the destination URL in the URL itself, in a query parameter. For example:

    http://www.example.com/Login.aspx?returnUrl=/TEST/content.htm

    EDIT: I do realize that everything you send to the client is very hackable anyway, but if you set it yourself, it’s easier for you to validate that it hasn’t been tampered with. An example is the ViewState validation methods.

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

Sidebar

Related Questions

I have the following code. NSData *pageData = [NSURLConnection sendSynchronousRequest:request returningResponse:NULL error:NULL]; NSString *webpage
Never thought I'd have this problem :) The following snippet of code works in
I have the following code to do this, but how can I do it
I have the following code: Bear in mind that while this code works on
I have the following code snippet: using (SPSite site = new SPSite(this.ListAddress)) { using
I have the following code: public virtual void Initialise() { this.AddHeader(SystemContext, this.UserSettings.SystemContext); } public
I have the following code: SPList list = web.Lists[this.ListName]; SPListItem item = list.Items.Add(); now
I have the following code: foreach (var control in this.Controls) { } I want
I have the following code that sets a cookie: string locale = ((DropDownList)this.LoginUser.FindControl(locale)).SelectedValue; HttpCookie
I have the following code: if (System.IO.File.Exists(htmlLocation)) { vEarthBrowser.ObjectForScripting = this; vEarthBrowser.Url = new

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.