Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

169
Vistas
Redirecting to previous page in asp.net

I have a web form which contains a submit button which updates the database.

After clicking the button I need to display a message and go back to the previous page after 2 seconds.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Regardless on technologies you use, you can simply store "back link" in the URL as one of the GET parameters and then use this URL to redirect user back to the required page. For example, your link might look like this:

/action/send/?backlink=/path/to/previous/page/

Of course, this link should be URL encoded and will look like this:

/action/send/?backlink=%2Fpath%2Fto%2Fprevious%2Fpage%2F

You can also send this link using POST method, alongside with the query for the database you might send. After the link being passed to the backend, you can place this link as a destination for redirect on the page with the message you want to show. You can use redirect by <meta> tag in HTML document like this:

<meta http-equiv="refresh" content="5;url=/path/to/previous/page/" />
  • 5 — Delay, amount of seconds before refresh will be fired;
  • url=/path/to/previous/page/ — Path for redirection.

As another solution, you can write JavaScript code which will do the same thing. Minimal implementation will look like this:

<script>
  // Wait for page to load
  window.addEventListener('load', function() {
    // Set the timer for redirection
    setTimeout(
      function () {
        location.href = '/path/to/previous/page/';
      },
      // Amount of milliseconds before refresh triggered
      5000
    );
  });
</script>
about 4 years ago · Juan Pablo Isaza Denunciar

0

Response.AppendHeader("Refresh", "2;url=page.aspx");

this works.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda