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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:13:34+00:00 2026-06-15T02:13:34+00:00

I have a form with various values ​​to enter by the user, then the

  • 0

I have a form with various values ​​to enter by the user, then the user sends the query and processes the search for result.

This is pretty simple, but the problem is this.

In MVC if the form has errors, to do validation on the server should show the form again with errors. but if I send my request to the data search action, I should come back with a redirect to the consultation action form and this would lose validation messages.

Currently we do is request the data to the action of the consultation form and then if everything is fine, we redirect action result sending the data of request with tempdata.

Is there any better way for this scenario?

  • 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-06-15T02:13:35+00:00Added an answer on June 15, 2026 at 2:13 am

    If I understand correctly, PRG pattern should work in your case. In post operation, if modelstate is invalid, redirect back to consultation form otherwise proceed with search operation. The filters will internally save the errors in tempdata.

    MVC3 model validation best practice redirect after post / state change

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

Sidebar

Related Questions

Say we have a form where the user types in various info. We validate
I have a form where users enter some text manually. Then I'd like to
I have a simple HTML form with a username and password. This HTML form
I have a form with various fields the user need to feel out with
I have am HTML form in a PHP page. The form has various inputs.
We have a C# win Form app called Installer that silently installs various 3rd
Javascript I have code that will hide various sections in a MS CRM form
I have form where are 2 input fields and then i have dynamic dataTables
I have form where user submits field. Field can have letters, numbers, and punctuation.
I have form in my page, I am using ajax.beginform(). Inside this form 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.