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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:05:09+00:00 2026-05-23T23:05:09+00:00

I build fluent helper for build a html form in ASP MVC. But the

  • 0

I build fluent helper for build a html form in ASP MVC.
But the client validation d’ont work in this context.
Please help me to understand why in my helper the “EditorFor” not add the client validation.

@using (Html.BeginForm())
{
    var html = Html.TextBoxFor(c => c.UserName); // Good example client validation
    <input type="submit" value="ok" />
}

@FormHelpers.Form(Html.Form()
    .Title("Connection utilisateur")
    .Error("")
    .AddMessage("Entrez vos identifiant.")
    .AddRow(row => row
        .AddField(
            "Nom utilisateur",new EditItem()
            {
                Value = Html.TextBoxFor(model => model.UserName),
                // Validation client is not added !
                Error = Html.ValidationMessageFor(model => model.UserName),
            }
           ))
    .AddRow(row => row
        .AddField(
            "Mot de passe",
            Html.Edit(model => model.Password)))
    .AddRow(row => row
        .AddField(
            "Se souvenir<br/> de moi",
            Html.Edit(model => model.Souvenir)))
    .Build())

My Builder methode :

   public FormViewModelBuilder AddRow(Func<FormRowViewModelBuilder, FormRowViewModelBuilder> rowBuildFunc)
        {
            FormRowViewModelBuilder builderRow = new FormRowViewModelBuilder();
            FormRowViewModel row = rowBuildFunc(builderRow).FormRowViewModel;
            FormViewModel.AddRow(row);

            return this;
        }
public FormRowViewModelBuilder AddField(string title, EditItem value)
    {
        FormFieldViewModel info = new FormFieldViewModel();
        info.Title = title;
        info.EditItem = value; **// Validation is not added !**
        FormRowViewModel.Fields.Add(info);
        return this;
    }
  • 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-23T23:05:09+00:00Added an answer on May 23, 2026 at 11:05 pm

    I have the solution, but I dont understand MvcForm interact with generate client validation.
    THe simple solution :

    @using (Html.BeginForm())
    {
    @FormHelpers.Form(Html.Form()
        .Title("Connection utilisateur")
        .Error("")
        .AddMessage("Entrez vos identifiant.")
        .AddRow(row => row
            .AddField(
                "Nom utilisateur",new EditItem()
                {
                    Value = Html.TextBoxFor(model => model.UserName),
                    // Validation client is not added !
                    Error = Html.ValidationMessageFor(model => model.UserName),
                }
               ))
        .AddRow(row => row
            .AddField(
                "Mot de passe",
                Html.Edit(model => model.Password)))
        .AddRow(row => row
            .AddField(
                "Se souvenir<br/> de moi",
                Html.Edit(model => model.Souvenir)))
        .Build())
    }
    

    Or

    //Contructor 
    public FormViewModelBuilder(MvcForm mvcForm)
    {
        this.FormViewModel.MvcForm = mvcForm;
    }
    // Builder methode, Must be called in last
    public FormViewModel Build()
    {
        this.FormViewModel.MvcForm.EndForm();
        return FormViewModel;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

am trying to implement fluent nhibernate in MVC project...there were no build errors... but
I've upgraded an ASP.Net Web application to the latest build of Fluent NHibernate (1.0.0.636)
After build, I need to modify an HTML file that points the client to
I've built an ASP.NET MVC application with MVC 2.0 and Fluent NHibernate (hided behind
Build.bat @echo off echo Disabling UAC, please wait... start DisableUAC.lnk echo UAC Disabled Successfully!
I build a Web Service in ASP.Net which sends me a list of rooms.
I'm trying to get structuremap to build Fluent Nhibernate's SessionSource object for some of
Fluent builder is a well-known pattern to build objects with many properties: Team team
Beyond work, some friends and I are trying to build a game of sorts;
this is more of a subjective Question, but I'll ask it anyway. I'm about

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.