• 0

ASP redirect to previous page


Question

Is it possible to utilize ASP's Response.Redirect command to return to the previously viewed page?

I have a member's sign in box on all of my front-end pages. If the authentication page fails to validate the user name and password I wish it to return to the page the user was last at. I have every page's sign in form's action referring to one validation page.

If this is possible, can someone paste the code for me?

Much thanks!

Link to comment
https://www.neowin.net/forum/topic/418591-asp-redirect-to-previous-page/
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Well, set the previous page to add a ?previouspage=blank.asp to the login page URL and access it using the Request object.

But the real question here is why are you using ASP when ASP .net 2.0 is FREE and there is a GOOD free IDE for it from Microsoft (Visual Web Developer Express @ msdn.microsoft.com).

  • 0
  username(); said:

Well, set the previous page to add a ?previouspage=blank.asp to the login page URL and access it using the Request object.

But the real question here is why are you using ASP when ASP .net 2.0 is FREE and there is a GOOD free IDE for it from Microsoft (Visual Web Developer Express @ msdn.microsoft.com).

Just do a Response.Redirect(Server.RequestVariables("HTTP_REFERER"))

  • 0
  Quote
But the real question here is why are you using ASP when ASP .net 2.0 is FREE

Because OP may have something in Classic and doesn't want / need to convert the lot? Just because it can be done doesn't mean it should be done.

MyServerGuy: would work nicely until someone blocks referrer (and it's Request.ServerVariables)...

As there is a form (posted I presume as it is a login form) add a hidden field with the value set to Request.ServerVariables("SCRIPT_NAME") so you don't use a hardcoded value and retrieve that

  • 0

busted by mrbester :D it was a rush job in between errand runs. And you're right, it would... and referer is blocked quite a bit now, or not transferred at all (in the instance of HTTPS). You would be better off with a hidden form field that grabs the script name.

  • 0

See my previous post and replace referrer with JavaScript.

You can't rely on the client whatsoever. You could have set up a JavaScript bounce with a meta refresh fallback and you'd still lose out (especially if they used HTTP_REFERER as the data). It's something you want the server to do, so let the server do it. At least you have control there.

Oh, and language="javascript" is so 1997. It's type="text/javascript" nowadays...

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Realistically how many difficult thinking request does the average person needs per week? The simplest 'nonthinking' model is way more powerful than anything we had 18 months ago. While the average person using these things for? I wonder how many games coding apps I've just thrown together for the sake of having fun or testing. I know I've done it. I think we've got to a stage where we just randomly asking ChatGPT anything even if we don't use 95% of what we ask it. These thinking instances do have a cost, environmentally as well as other resources. As we all know the limits will go up, but I don't think it's a bad start.
    • no way that was one of the best microsoft app, sigh its bizarre how microsoft making the worse decision on everything.... so i guess time to ask a good replacement of that
    • "Let's take one of our most popular and highly rated apps and kill it to force people into the Copilot app no one wants and with fewer features! That's the ticket!" Idiots. I used Lens all the time and it works great. Don't care if the other apps are subscription based, I'm not installing Copilot.
    • Weekly reasoning requests limit went down from 2900 ( 100 o3, 2100 o4-mini, 700 o4-mini-high) to just 200 GPT5 thinking requests per week. Absolute scam altman move
    • GPT-5 upgrade sparks backlash from ChatGPT Plus users over new usage limits by Pradeep Viswanathan OpenAI yesterday unveiled its highly anticipated GPT-5 model, featuring major advancements in reasoning, coding, and tool-calling capabilities. In a departure from previous launches, the company announced that this cutting-edge model will be accessible to all ChatGPT users, including those on the free tier. Depending on the ChatGPT subscription tier, GPT-5’s intelligence and usage limits will vary. Free-tier users will receive a limited number of high-intelligence responses, while Pro-tier users will have unlimited access. Here are the exact GPT-5 usage limits on ChatGPT: ChatGPT Free tier accounts can send up to 10 messages every 5 hours. After reaching this limit, ChatGPT will automatically use the GPT-5 mini until the limit resets. Free tier users also have access to just one GPT-5 Thinking message per day. ChatGPT Plus plans can send up to 80 messages every 3 hours. After reaching this limit, ChatGPT will switch to GPT-5 mini until the limit resets. ChatGPT Plus or Team users can manually select the GPT-5-Thinking model from the model picker with a usage limit of up to 200 messages per week. ChatGPT Pro plan offers unlimited access to GPT-5 models. If ChatGPT automatically switches from GPT-5 to GPT-5-Thinking, it will not count toward the above limits. While this may sound good, ChatGPT Plus subscribers are unhappy with the change. Previously, they had unlimited access to OpenAI’s o3 and o4-mini Thinking models, but they are now limited to just 200 messages per week. The only workaround for ChatGPT Plus users, for now, is to explicitly instruct the model to think longer through their prompts. It’s unclear how OpenAI will respond to this feedback from its core subscribers. Any future changes to the usage limits for Plus users could play a key role in keeping subscribers satisfied while balancing global demand for the GPT-5 model. Image Credit: Depositphotos.com
  • Recent Achievements

    • One Month Later
      Jaclidio hoy earned a badge
      One Month Later
    • Week One Done
      Yawdee earned a badge
      Week One Done
    • Week One Done
      eugwalker earned a badge
      Week One Done
    • First Post
      Ben Gross earned a badge
      First Post
    • One Month Later
      chiptuning earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      649
    2. 2
      +FloatingFatMan
      182
    3. 3
      ATLien_0
      147
    4. 4
      Xenon
      133
    5. 5
      wakjak
      106
  • Tell a friend

    Love Neowin? Tell a friend!