1
Vote

Remote Validation Areaname

description

The remote validation areaName is not working properly. Please check the generated data-val-remote-url and you can find the current area in the value.

[System.Web.Mvc.Remote("IsUserNameAvailable", "Account", "", ErrorMessageResourceName = "RemoteUserName", ErrorMessageResourceType = typeof(Resources.Models.ErrorMessages))]

comments

HongmeiG wrote Aug 13, 2012 at 4:53 PM

Add a new Area property on the remote attribute.

marcind wrote Aug 23, 2012 at 4:54 PM

Hongmei, RemoteAttribute already has an area parameter in the constructor.

This looks like a legitimate issue where if you use a model that specifies remote validation using an "area-less" controller from a view located in an area, then the runtime will still pick up the area name when generating the link to the remote validation even though it shouldn't.