Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

0

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

this works.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda