Model Binding in Razor Pages

18 Nov 20181 minute to read

This article deals with the model binding of the Razor Pages of the ASP.NET Core platform. Refer to this Page Model section for the detailed instructions on how to create a page model.

The model binding provides data to the page models and Razor pages. OnGet is a handler method that will be executed once the Razor page gets loaded in the browser. value in the form tag retrieves data from the OnGet method in the IndexModel class using the model binding.

Form Post Back

This sample explains the form post back properties of the rich text editor rendering with the razor page. The Rich text editor is rendered within the form tag and the value post and attribute method has been given into the form tag. Any value into the Request.Form in the OnPost method will be considered as a string and those string should be mapped to the name field of the Rich Text Editor.