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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:03:03+00:00 2026-05-26T21:03:03+00:00

Anybody? There is another question regarding this but the only answers were to code

  • 0

Anybody? There is another question regarding this but the only answers were to code up some javascript validation, which also refuses to work on my partial view (“$ is not defined”).

Anyway, I don’t want to use javascript I just want simple validation for required fields that cannot be left blank, number fields that require ints, etc.

Can anyone shed some light on validation and partial views?

  • 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-26T21:03:04+00:00Added an answer on May 26, 2026 at 9:03 pm

    I suspect that you are loading those partial views using AJAX. If this is the case you will need to manually invoke the $.validator.unobtrusive.parse method once you inject the new contents of the partial into the DOM as explained in this article.

    Brad Wilson also discussed this in his blog post:

    The unobtrusive client validation script automatically parses the
    initial set of HTML for validation rules when the page has finished
    loading. If your page dynamically adds new HTML content (perhaps
    throught Ajax or through client-side application code), you may wish
    to parse that new HTML for client validation on the new HTML elements.

    To parse new HTML, you can call the
    jQuery.validator.unobtrusive.parse() method, passing it a selector for
    the HTML that you would like to be parsed. You can also call the
    jQuery.validator.unobtrusive.parseElement() function to parse a single
    HTML element.

    As far as the $ is not defined error you should make sure that you have included the proper scripts:

    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    

    Also make sure you are not referencing any of the Microsoft*.js scripts. They are obsolete and should no longer be used in ASP.NET MVC 3.

    Of course that’s only a supposition, you haven’t shown any code so we cannot know what you are doing.

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

Sidebar

Related Questions

Quick question. I have been Googling this all morning, but it's either not there,
I was wondering if anybody out there had some good tips/dos and don'ts for
I have a question! I'm not sure if this is possible, but... I have
I think this is a beginner question, it is regarding the variable references across
I have a question very similar to this one but the answer does not
Note : I know there are many questions related to this, but still I
I have asked another question related to this in this thread Where to put
This is going to sound like a dumb question, but I was wondering where
Well I think I know the answer to this, but I would appreciate anybody
Anybody out there using BGL for large production servers? How many node does your

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.