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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:38:17+00:00 2026-06-11T09:38:17+00:00

I’ve got a simple question. If I’m using a Response.Redirect(), will that kill all

  • 0

I’ve got a simple question. If I’m using a Response.Redirect(), will that kill all page functionality assuming the user cancels the redirect?

For example, pretend I have a page with a button that, when pressed, pops up a message that says “hi”. Then, at some point in the code, the user encounters a Response.Redirect(). Before the page is cleared on the browser, they hit STOP in their browser. Then, they click the button. Will it still say “hi”, or will the page be non-functional?

EDIT FOR MORE INFORMATION:
Maybe I am just not understanding the answers, but I still don’t have an answer to my question.
Let me rephrase to be more precise.

I have two buttons that both execute a C# function when they are clicked. One of them executes a Response.Redirect() to a different page. The other prints out “Hi” in a message box. The user presses button 1. The response.redirect starts processing, but before the user is redirected they decided that they made a mistake and they hit the STOP button in their browser. The user is still looking at the same web page. They click on button #2. My question is, does the message “Hi” pop up? Does the C# function still work? Or would the code behind be inaccessible after the attempted redirect?

  • 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-11T09:38:18+00:00Added an answer on June 11, 2026 at 9:38 am

    Solution
    Users on a slow network connection do see the initial page for a little longer.
    If all you want to do is prevent them from pressing those buttons by mistake, you can create a <div> to cover your entire screen area and grey it out with a semi-transparent image. Users will not be able to click buttons unless they refresh the page.

    You can get this effect easily by showing a jQuery modal dialog on form submit, with a message to the user that the data is being saved.

    This solution will only prevent the accidental click. If you want to prevent malicious repeated requests, in addition to the modal dialog you should track your application state on the server and indicate that a save has already taken place. A simple session variable should suffice to indicate this.

    Technical explaination
    The http protocol used by the web server is stateless. Every time you send a request to the server, it builds your Page object to service this request and returns a reply. It will not remember what you send it last time. If you need that, you have to do it yourself.

    When you click the “hi” button, in your c# code you set the message. In reply to this request the server replies with a success status message HTTP/1.1 200 OK as the first line of the response. This tells the browser that everything is ok, and it will process the response based on the Content-Type header returned.

    When you click the button to redirect to another page. Your browser sends a request to the first page. There when you execute a Response.Redirect your server send back a redirect message to the browser.

    HTTP/1.1 302 Found
    Location: http://Page2URL
    

    This tells the browser that it has to go to this new location to get a response. The browser now makes a new request to the url mentioned by the location header and gets the response.

    The user may abort the request at any of these stages. Since http is stateless, you can resubmit and of the two requests or click on another button and make a new request. The server will dutifully send it to asp.net like nothing ever happened and you will get a response.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm making a simple page using Google Maps API 3. My first. One marker
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has

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.