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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:09:56+00:00 2026-05-13T15:09:56+00:00

When I validate a form with Asp.Net Mvc and there’s an error on the

  • 0

When I validate a form with Asp.Net Mvc and there’s an error on the form, Asp.Net return me the form with the correct error message but clear the content of the input. I would like the content of the input to stay even if this content is wrong. How can I do that ?

UPDATE

Maybe this is because I don’t use the default validation. I use the Fluent Validation library.

Here what I do :

var validator = new UserValidator();
var results = validator.Validate(user);
results.AddToModelState(ModelState, "");

if (!ModelState.IsValid) 
{
     return View("SignUp", user);
}
  • 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-13T15:09:57+00:00Added an answer on May 13, 2026 at 3:09 pm

    The problem might be in how you “bind” the model you are passing in the view. If you use a strongly typed view and create the input fields with for example

    <%=Html.TexboxFor(m=>m.UserName)%> 
    

    or

    <%=Html.TextBox("UserName", Model.UserName)%>
    

    then you should see the values after posting.
    Regards

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

Sidebar

Related Questions

What are the ways to validate form data (in ASP.NET MVC and C#) such
I have to build a registration form using asp.net mvc 3 jquery validate. That
Im using asp.net webforms. c# I want to validate a form. In the codebehind
I'm using asp.NET MVC 2 for my current project and I need to validate
I am using asp.net mvc 2.0 and jquery validate 1.7 ( http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ) What
I have a simple form on an ASP.NET MVC site that I'm building. This
How do you set the id of an Html.Form in ASP.NET MVC 2? I
Just wondering, I strongly type these views in ASP.NET MVC and then use Request.Form
I am working on rendering a dynamic form in an ASP.NET MVC view that
I'm using asp.net mvc 3 with unobtrusive jquery validation. I have a form that

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.