คำถามติดแท็ก custom-model-binder

5
ASP.NET MVC คำขอที่อาจเป็นอันตรายตรวจพบค่าแบบฟอร์มจากไคลเอนต์เมื่อใช้ modelbinder ที่กำหนดเอง
รับข้อผิดพลาดที่นี่: ValueProviderResult value = bindingContext.ValueProvider.GetValue("ConfirmationMessage"); ฉันจะอนุญาตเฉพาะค่าที่เลือกได้อย่างไร กล่าวคือ [ValidateInput(false)] public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { ValueProviderResult value = bindingContext.ValueProvider.GetValue("ConfirmationMessage"); ValueProviderResult value2 = bindingContext.ValueProvider.GetValue("ConfirmationMessage2"); }
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.