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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:42:20+00:00 2026-06-15T14:42:20+00:00

I have the following data model public class User { [Required(ErrorMessage = First name

  • 0

I have the following data model

public class User
{
        [Required(ErrorMessage = "First name required!")]
        public string FirstName { get; set; }

        [Required(ErrorMessage = "Last name required!")]
        public string LastName { get; set; }
}

I have the following view called “UserForm” that uses the above model

@model User
@using (Html.BeginForm("myAction", "MyController"))
{
@Html.TextBoxFor(model => model.FirstName)
@Html.TextBoxFor(model => model.LastName)
@Html.ValidationSummary()
<input type="submit" value="Save" />
}

I have tested the above code and unobtrusive validation and form posts work correctly and without any issues. However, if I include the above view as a partial view in a second view as shown below, then client side unobtrusive validation stops working.

<div id="myPartialView">
<!-- Include form as partial view -->
@{Html.RenderAction("myAction", "MyController");}
</div>

I tried explicitly reloading unobtrusive validation using the following line of javascript

jQuery.validator.unobtrusive.parse('#myPartialView');

Now validation is working but I am unable to submit the form. I used fiddler and I can see that clicking on the submit button is not triggering any activity. Any thoughts on what I may be doing wrong?

  • 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-15T14:42:21+00:00Added an answer on June 15, 2026 at 2:42 pm

    For anyone stumbling across this question, I have this issue resolved now. My forms were embedded in a Jquery Modal box and I had an invalid html tag. This was not causing the modal to stop working but was stopping my form from submitting. (I am still not sure why). I found this error using the excellent html validator from w3c

    http://validator.w3.org

    It should be noted that I still need

    jQuery.validator.unobtrusive.parse('#myPartialView');
    

    to get client side validation to work for dynamic content. This is a well known issue which is discussed in more detail in the link posted by @Mate above

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

Sidebar

Related Questions

I have the following model: public class Product { public int Id { get;
I have following data structure (simplified): A giant list of the class TestClass public
I have the following Model : public class FileModel { public int Id {
I came across the following issue: I have this model public class Region {
I have the following snippets in my MVC 3 website. Model: public class Item1
I have a simple Sencha Touch 2.1 model class: Ext.define('App.model.User', { extend: 'Ext.data.Model', config:
I have the following model entity: public class ScheduledTask { public virtual int ScheduledTaskId
I have the following model Public Class BaseViewModel Public Property Id as integer Public
I have the following data model: I am writing a WCF service that needs
I have the following situation: I have class User with the follwing properies :

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.