开发者

MVC 3 client side validation on textbox list

开发者 https://www.devze.com 2023-04-11 12:26 出处:网络
If I allow the user to add text boxes to a view how can I still have my model validation work correctly? I want to be able to send back an array of FanId\'s to check (which I have done successfully).

If I allow the user to add text boxes to a view how can I still have my model validation work correctly? I want to be able to send back an array of FanId's to check (which I have done successfully). The problem is that remote validation on each text box sends back the value of the first text box.

Model:

[DisplayName("User ID")]
[Remote("ValidateUser","Template",ErrorMessage = "Invalid User I开发者_运维知识库d")]
public string[] FanId { get; set; }

Currently I am hard coding the inputs to be added.

0

精彩评论

暂无评论...
验证码 换一张
取 消