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

  • Home
  • SEARCH
  • 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 6577783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:40:59+00:00 2026-05-25T15:40:59+00:00

What I want to do is when user clicks a submit button, the backend

  • 0

What I want to do is when user clicks a submit button, the backend code will add it into database, and show a success message in client before the page is redirect to the next page. How do I write code in backend? I use

this.ClientScript.RegisterClientScriptBlock(this.GetType(), "clientScipt", "<script>alert('Done!');</script>");

But the message never shows, it just jumps into next page directly.

Help is appreciated.

  • 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-25T15:41:00+00:00Added an answer on May 25, 2026 at 3:41 pm

    In the few apps where this has been requested, we have a “Success.aspx” page. The page simply shows a success message, and then does a timed redirect to the next page. Usually, we pass along the redirect target as a POST variable.

    The timed redirect is handled by Javascript similar to this:

    <script type="text/JavaScript">
    <!--
    setTimeout("location.href = 'http://whateverpage.aspx;",1500);
    -->
    </script>
    

    We do it via javascript (client-side) because you can do a redirect in server-side code, but not with a delay. The Redirect is immediate and the “Success” message is never displayed.

    I do feel compelled to add, however, that these “Success” pages are somethign we stopped doing unless the user explicitly asks for it because they become very annoying after a while. They seem like a good idea at the time, but provide a very poor suer experience. You might be better served just putting a “Success” message next to the buton and using the same setTimeout function to then set the display of that “Success” to “none” so that it disappears after a few seconds.

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

Sidebar

Related Questions

When a user clicks a submit button I want the form to be submitted.
When the user clicks the submit button on a form I want to return
When the user clicks a button, I want his browser to automatically scroll to
When the user clicks an Edit button on my form, I want a box
In my application when a user clicks on a button I want to open
I want to, when the user clicks a button on my website, to make
I have an ASP.NET2.0 web page with a Submit button. When the user clicks,
How can I display an alert after a user clicks a submit button in
I'd like to replace my_div 's content after user clicks the submit button with
I have two jsp pages and one servlet. When user clicks submit button then

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.