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
I've just learned what ASP.NET MVC is and I'm wondering if the pattern is
What is the best ASP.NET MVC pattern for paging data when the data is
In an ASP.NET MVC application implementing the repository pattern I am curious if it
I'm really new to both ASP.NET MVC and the MVC pattern generally. For context,
MVVM is a Microsoft design pattern that existed before ASP.Net MVC. Can anyone through
How can i make drop down as read only in the asp.net MVC Pattern
Possible Duplicate: Biggest advantage to using ASP.Net MVC vs web forms maybe it feels
Background: I am using Nhibernate in an ASP.NET MVC application with an open-session-in-view pattern
This query is about MVC design pattern in general and not ASP.net MVC framework

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.