I've read How to use Bind Prefix?
but, here is my code and it doesn't work. the controller name is: "UserInfo.user_name"
public JsonResult UniqueUserName([Bind(Prefix="UserInfo")] string user_name)
{//user_name == null ?!?}
Thank's
UPDATE
adding my view:
@Html.EditorFor(x => x.UserInfo)
and this is the EditorTemplate:
<div>
@Html.LabelFor(m => m.user_name)
@Html.TextBoxFor(m => m.user_name, new { required = true})
@Html.ValidationMessage("user_name", new { @class = "error"})
</div>
this is the model: I've removed from here more properties and more class since it makes no difference.
public class Info
{
[DisplayName("User Name")]
[Required]
[Remote("UniqueUserName", "Create")]
public string user_name { set; get; }
}
public class EvalInfo
{
public Info UserInfo { set; get; }
public EvalInfo()
{
UserInfo = new Info();
}
}