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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:35:58+00:00 2026-05-21T22:35:58+00:00

I’m triying to make work remote validation in ASP MVC3. I spended some hours

  • 0

I’m triying to make work remote validation in ASP MVC3. I spended some hours reading and trying it, but i didn’t achieve it.

First of all … I’ve added this lines to appSettings in Web.config file

<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>

Then, I make a class with dataanotations.

Public Class PackageCreationInfo

    'Lot of Properties here...
    <DisplayName("Id Modalidad")>
    <Remote("ModeExists", "PreactivatedLicenses", AdditionalFields:="IdVersion")>
    Public Property IdMode As Integer
    <Required(ErrorMessage:="La Versión es obligatoria")>
    <DisplayName("Id Versión")>
    Public Property IdVersion As Integer

End Class

In my view I added this scripts

<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>

And I’ve this ones in my _layout

  <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>  
    <script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.datepick-es.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Plugins/Expander/expand.js")" type="text/javascript"></script>

Then, In my controller, I’ve this function

 Public Function ModeExists(ByVal IdMode As Integer, IdVersion As Integer) As JsonResult

            Dim ExistModeForThisVersion As Boolean = _ProductApps.ExistModeForVersion(IdMode, 13)

            If (ExistModeForThisVersion) Then
                Return Json(String.Format("Esta modalidad no está disponible en la versión seleccionada."), JsonRequestBehavior.AllowGet)
            Else
                Return Json(True, JsonRequestBehavior.AllowGet)
            End If

        End Function

My problem is that I can’t get this function called.
The facts is that the generated HTML don’t have a data-val-remote attribute or something like it.

Other client validations that are not “remote” are working propertly.
What could be the problem?

Thanks.

  • 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-21T22:35:59+00:00Added an answer on May 21, 2026 at 10:35 pm

    Sorry… I made a stupid mistake (another one)

    I will write here my mistake as a penitence because there is remote posibility that It helps to someone.

    In my View… I wrote

     @Html.DropDownList("IdProgramMode", New SelectList(ViewBag.ProductModesList, "Id", "Mode"))
     @Html.ValidationMessageFor(Function(model) model.IdMode)
    

    But It should be

     @Html.DropDownList("IdMode", New SelectList(ViewBag.ProductModesList, "Id", "Mode"))
     @Html.ValidationMessageFor(Function(model) model.IdMode)
    

    It’s important that the name of the field match the name of the property. Otherways nothing will happens.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into

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.