Remote Validation in ASP.Net MVC 3: How to use AdditionalFields in Action Method

前端 未结 3 1000
慢半拍i
慢半拍i 2020-11-28 07:26

I\'ve been using the new ASP.Net MVC 3 RemoteAttribute to send a remote call to an action method that had a single parameter. Now I want to pass in a second parameter using

3条回答
  •  甜味超标
    2020-11-28 08:19

    Your hidden field must be inside the same form as the field your are validating ( like it is in Darin's example ), otherwise the hidden field's value will not be sent as parameter to the validation action method "public ActionResult IsEmailAvailable(string email, string initialEmail)"

提交回复
热议问题