You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Razor Pages is an alternative to the MVC pattern that makes page-focused coding easier and more productive. This approach consists of a `cshtml` file and a `cshtml.cs` file (by design, the two files have the same name).
12
-
13
11
You can seamlessly integrate the Telerik UI DropDownList for {{ site.framework }} in Razor Pages applications.
12
+
This article describeshow to configure the DropDownList component in a Razor Pages scenario.
13
+
For the complete project, refer to the [DropDownList in Razor Pages example](https://github.com/telerik/ui-for-aspnet-core-examples/tree/master/Telerik.Examples.RazorPages/Telerik.Examples.RazorPages/Pages/DropDownList).
14
14
15
-
This article describes how to configure the ASP.NET Core Razor DropDownList in a Razor Pages scenario.
16
-
17
-
For the complete project, refer to the [DropDownList in Razor Pages example](https://github.com/telerik/ui-for-aspnet-core-examples/blob/master/Telerik.Examples.RazorPages/Telerik.Examples.RazorPages/Pages/DropDownList/DropDownListCrudOps.cshtml).
18
-
15
+
## Getting Started
19
16
In order to set up the Razor DropDownList component bindings, you need to configure the `Read` method of its `DataSource` instance. The URL in this method should refer the name of the method in the PageModel. In this method, you can also pass additional parameters, such as filter string and antiforgery token (see `dataFunction`).
1. Within the `cshtml.cs` file, add a handler method for the Read operation that returns the dataset.
86
+
87
+
```tab-PageModel(cshtml.cs)
88
+
public JsonResult OnGetRead(string filterValue)
71
89
{
72
90
if (filterValue != null)
73
91
{
@@ -77,10 +95,13 @@ In order to set up the Razor DropDownList component bindings, you need to config
77
95
}
78
96
return new JsonResult(orders);
79
97
}
80
-
```
98
+
```
81
99
82
100
## See Also
101
+
* [Using Telerik UI for ASP.NET Core in Razor Pages](https://docs.telerik.com/aspnet-core/getting-started/razor-pages#using-telerik-ui-for-aspnet-core-in-razor-pages)
102
+
* [Client-Side API of the DropDownList](https://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist)
103
+
* [Server-Side HtmlHelper API of the DropDownList](/api/dropdownlist)
104
+
* [Server-Side TagHelper API of the DropDownList](/api/taghelpers/dropdownlist)
0 commit comments