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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:30:46+00:00 2026-06-01T17:30:46+00:00

I have a MVC3 view that enables the user to create a couple different

  • 0

I have a MVC3 view that enables the user to create a couple different things. Within the parent view the forms to do so are broken up via jquery ui tabs like the following:

<div id="tabs">
        <ul>
            <li><a href="#tabs-1">New Thing 1</a></li>
            <li><a href="#tabs-2">Different New Thing</a></li>
        </ul>
    <div id="tabs-1">@Html.Action("CreateNewThing", "NewThingController")</div>
    <div id="tabs-2">@Html.Action("CreateDifferentThing", "DifferentThing")</div>
    <div></div>
</div>

<script type="text/javascript">
    $(function () {
        $("#tabs").tabs();
    });
</script> 

Within the partial view I have:

@model NewThingViewModel

    @using (Html.BeginForm("CreateNewThing", "NewThingController", FormMethod.Post, new { id = "frmCreateNewThing" }))
    { 
    ...

with input fields, a submit button, etc. This seems to work well: it renders everything and posts just fine to the right controller action method.

However I’m now wiring in the validation and I’ve got an issue.

In the controller it is rendering the view like so:

public ActionResult CreateNewThing(NewThingViewModel model)
{

 ... initializing model fields, drop downs etc.

    return PartialView("CreateNewThing", model);
}

I have a seperate post method like so:

 [AcceptVerbs(HttpVerbs.Post)]
 public ActionResult CreateNewThing(NewThingViewModel newThingViewModel, FormCollection collection)
 {
         .....
 }

Sample Model:

    public class NewThingViewModel
    {
        [Required]
        [StringLength(50)]
        [Display(Name = "Display Name:")]
        public string DisplayName { get; set; }     
     }

The trouble is, when the page first comes up the fields marked as [Required] through DataAnnotations in the model are showing up red as well as the validation summary showing them invalid when the page initially shows. I.E. it’s acting like it’s already been posted before the user gets to enter anything on the initial load or even put anything in the text boxes.

I know the first non-post CreateNewThing is firing because I can catch it in the debugger and I know the 2nd one does not on the initial load.

What would cause my validations to fire on the Get?

Is it due to the way Html.Action works and the fact that I’m rendering partial views onto another view?

I’m using UnobtrusiveJavaScriptEnabled and ClientValidationEnabled = true in web.config.

I can’t find anyone else that has run into this particular problem. Every other example just seems to work, then again I don’t find an example where the view is broken into three partials contained within jquery ui tabs.

How do I fix this?
Options:
Do I need to manually manipulate the Model.IsValid as a workaround?
Use a different mechanism to render the partial views on the parent view instead of Html.Action?
Use some javascript/jquery to catch the validation and stop it?

  • 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-01T17:30:47+00:00Added an answer on June 1, 2026 at 5:30 pm

    Don’t have method parameters on your GET controller action. You can initialize an empty model and pass it to the view but you dont need a model to be passed into the method

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

Sidebar

Related Questions

I have an MVC3 View that's posting back a set of input values via
I have an MVC3 Razor view which has a link that requires user login
MVC3 VB.NET Razor view Application... I have a view that uses a for each
I have an MVC3 view that's design to run reports for our clients. In
I have an MVC3 application with Razor and I created a View that inside
I have a C#.NET MVC3 web app. I have a View that has a
Using ASP.net MVC3 with C# I want to create a partial view that uses
I have an MVC3 site that needs to handle user posts. I am trying
In my MVC3 application, I have a view model that I Json encode so
I have an MVC3 project I'm working on that has a View with an

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.