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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:45:16+00:00 2026-05-12T08:45:16+00:00

The ASP.NET MVC pattern of submitting forms via post, then redirecting to the same

  • 0

The ASP.NET MVC pattern of submitting forms via post, then redirecting to the same or different URL is very easy to code.

Imagine this scenario:

  1. User goes to /products/42/edit to view and edit product 42.
  2. They see something crazy on that page, edit it, and hit save. This causes a POST to /products/42/edit
  3. The action updates the data and redirects to or returns the view for /products/42/edit
  4. The user sees the updated data and is happy.
  5. One hour later they click refresh to see if anyone else has messed with product #42.
  6. Because the last retrieval for /products/42/edit was a POST, their browser asks to resubmit the form data. This is annoying and dangerous because it can overwrite someone else’s data.

I fear that even if I use two different URLs for the POSTs and GETs (say /products/42/edit and /products/42), that the browser will still ask for the repost and can destroy data. Am I mistaken?

What alternative methods can be used so that after submitting product changes, the user can safely hit refresh to get an updated view?

Update I see now that my question and my design were muddled, my apologies for that. I see that it was a bad idea for me to share URLs (actions) between the POST and the GET. Am I right to assume then that if those two are different, then I won’t have the “refresh causes rePOST” problem?

  • 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-12T08:45:16+00:00Added an answer on May 12, 2026 at 8:45 am

    To your update: yes.

    Use /product/{id}/ for viewing, and /product/{id}/edit for editing, and after the edit, redirect them to /product/{id}/.

    Problem solved. Was wondering why you are/were using /product/{id}/edit for both viewing and editing.

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

Sidebar

Related Questions

I'm kind of new to ASP.NET MVC and to the MVC pattern in general
asp.net mvc routing pattern is {some_parameter/{controller}/{action}/{id}} Is this a valid format if some_parameter can
On my web site (asp.net mvc), I use cookie to store search pattern. when
I've just learned what ASP.NET MVC is and I'm wondering if the pattern is
I currently use the repository pattern in my ASP.NET MVC 3 app. I use
I want to make an implementation with repository pattern with ASP.NET MVC 2 and
I am trying to implement a session-per-request pattern in an ASP.NET MVC 2 Preview
What is the best ASP.NET MVC pattern for paging data when the data is
What is the best logging pattern for asp.net mvc 2 using log4net? When should
I have implemented a repository pattern in my asp.net mvc web application... But i

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.