Are Razor Pages supported by the Forms widget. I keep getting an unhandled exception caught in the middleware after the Exception Handler has completed and nothing is returned just the <div></div> that I placed around it
The Form can be used in RazorPages. Attached you can find a sample RazorPages project, in which a Form is initialized.
Regards,
Ivan Danchev
Progress Telerik
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.
A key thing in allowing the form to be rendered was the .FormData(TModel model) call. Without it there's nothing on the screen.
However the next issue is the Post call - its returning an error 400. I would assume that since the form values will be passed using a [BindProperty] then the signature of my method should be:
IActionResult OnPost()
Digging deeper I've found that the post is failing due to the anti forgery token not being passed in. With the Grid component all I had to do was add a .Data("forgeryToken") method. Is there a similar method for Form?