Câu hỏi được gắn thẻ «custom-model-binder»

5
ASP.NET MVC Một giá trị Request.Form có thể nguy hiểm đã được phát hiện từ máy khách khi sử dụng một trình mô hình tùy chỉnh
Bắt lỗi ở đây: ValueProviderResult value = bindingContext.ValueProvider.GetValue("ConfirmationMessage"); Làm cách nào để chỉ cho phép lựa chọn các giá trị? I E [ValidateInput(false)] public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { ValueProviderResult value = bindingContext.ValueProvider.GetValue("ConfirmationMessage"); ValueProviderResult value2 = bindingContext.ValueProvider.GetValue("ConfirmationMessage2"); }
Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookie và Chính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.