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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:27:50+00:00 2026-05-14T00:27:50+00:00

I have a page request with a QueryString, say http://www.xyz.net/Orders.aspx?OrderID=1 . The page is

  • 0

I have a page request with a QueryString, say http://www.xyz.net/Orders.aspx?OrderID=1. The page is displayed in a browser. Now there is an asp:LinkButton on the page which should enable the user to open the page without the QueryString (as if he had entered http://www.xyz.net/Orders.aspx directly in the browser’s address bar).

I had two ideas:

1) Use the PostBackUrl attribute of the LinkButton:

<asp:LinkButton ID="LinkButton1" runat="server" Text="Select"
    PostBackUrl="~/Orders.aspx" />

2) Use “RedirectUrl” in an event handler:

<asp:LinkButton ID="LinkButton1" runat="server" Text="Select"
    OnClick="LinkButton1_Click" />

…and…

protected void LinkButton1_Click(object sender, EventArgs e)
{
    Response.Redirect("~/Orders.aspx");
}

In both cases the browser’s address bar shows http://www.xyz.net/Orders.aspx without the QueryString, as I like to have it. But in the first case the page does not change at all. But it should, because I’m evaluating the QueryString in code-behind and control the appearance of the page depending on whether a QueryString exists or not. The second option works as intended.

If I am not wrong the second option requires an additional roundtrip:

  • Browser sends request to server
  • Event handler on server side sends Redirect URL to browser
  • Browser sends again request to the server, but with the new URL
  • Server sends new requested page to browser

Is this correct at all?

Whereas the first option omits the first two steps in the list above, thus saving the additional roundtrip and resulting in:

  • Browser sends request to the server, but with the new URL (the PostbackURL specified in the LinkButton)
  • Server sends new requested page to browser

But, as said, the result isn’t the same.

I’m sure my try to explain the differences between the two options is wrong somewhere. But I don’t know where exactly.

Can someone explain what’s really the difference? Do I really need this second roundtrip of option (2) to achieve what I want?

Thanks in advance!

Update and solution

The author of the question (me) has proven with this question that he does not understand the difference between HTTP POST and GET. For the solution see my comment in egrunin’s answer.

  • 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-14T00:27:51+00:00Added an answer on May 14, 2026 at 12:27 am

    If you don’t want to hit the server, why not use a plain HTML control:

    function stripQuerystring()
    {
        return window.location.protocol + "//" 
            + window.location.host + window.location.pathname;
    }
    
    <input type="button" 
        onclick="javascript:window.location = stripQuerystring();" 
        value="Click Me">
    
    • 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 in my asp.net login page: if (Request.QueryString[ReturnUrl] != null)
Assuming I have a page request which goes like http://localhost/accounting/products?id=234 and sometimes it goes
I have a ASP.NET website. If I make a request for a page it
I have a page which will have these urls, http://localhost:1218/Order-AUG17/Forms/Order.aspx?ContactName=HajaMubeen and http://localhost:1218/Order-AUG17/Forms/Order.aspx and in
I have two aspx page on my application. From the first one, lets say
Okay, I have this code: <script language=javascript type=text/javascript> <!-- function requestPage(page) { var request
I have a registration page, and because of content issues we have to request
It seems redundant to have zlib compress a web page during every request. It
I have two drop downs on a page whose backing bean is Request Scoped.
How do I pass have a Javascript script request a PHP page and pass

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.