Answer (Choose 1 answer)
Model Binding in Razor Pages is the process that takes values from HTTP requests and n handler method parameters. Choose the correct way to bind the posted form values to ha parameters.
A. public class ModelBindingDemo: PageModel
{
public void OnGet()
public void OnPost(string name, string email)
{ } ViewData["confirmation"] = $"{name}, information will be sent to (email}";
}
B. public class ModelBindingDemo: PageModel
{
[BindProperty]
public string Name { get; set; }
BindProperty][
public string Email { get; set; }
public void OnGet()
public void OnPost()
{ } ViewData["confirmation"] = $"{Name}, information will be sent to {Email}";
}
C. [BindProperties]
public class Model Binding Demo: PageModel
[BindProperty]public string Name { get; set; }
[BindProperty]
public string Email { get; set; }
public void OnGet()
public void OnPost()
ViewDatal"confirmation"] = "(Name) information will be sent to (Email)"-
Exit 32