зеркало из
1
0
Форкнуть 0
This commit is contained in:
Tsvetomir Milchev 2020-01-21 14:07:16 +02:00
Родитель e9c3f8e0a0
Коммит 0d309b8664
3 изменённых файлов: 100 добавлений и 95 удалений

Просмотреть файл

@ -1,45 +1,49 @@
# aspnet-core-examples
A collection of Telerik UI for ASP.NET Core examples
- The sample ASP.NET Core projects are provided to demonstrate different frequently asked questions, features and scenarios.
- They are not part of our testing procedures and should be regarded as a knowledge base.
- Projects are tested only upon creation as well as when updating or upgrading the project.
- Mandatory prerequisite is to have installed ASP.NET Core 3.0
To run the projects from this repository:
1. Clone the repo
## Kendo.Examples.Mvc
1. Open the Kendo.Examples.Mvc.sln file in VS2019
2. Clean the solution
3. Build the solution and run the project.
4. Navigate to a certain example by adding the ControllerName/ActionMethod to the URL, i.e https://localhost:44361/ajaxbinding/ajaxbinding
> The project uses a local database which is created upon building the project based on the existent migrations.
## Kendo.Examples.RazorPages
1. Open the Kendo.Examples.RazorPages.sln file in VS2019
2. Clean the solution
3. Build the solution and run the project.
4. Navigate to a certain example by adding the PageFolder/ViewName to the URL, i.e https://localhost:44361/grid/gridcustomdatasource
## Examples descriptions
### Editor/EditorContent
#### This project demonstrates how you can add, read, edit and delete text data using a local database and the Editor component
> Please note that the current project doesn't have any XSS attack preventions applied. It is a developer's responsibility to manage these security risks. For more information, please refer to this [Preventing Cross-Site Scripting](https://docs.telerik.com/kendo-ui/controls/editors/editor/preventing-xss) article.
### MultiSelect/GetPostData
The MultiSelect is a `<select multiple>` element and behaves like one in a POST query - the browser will add a form data field with the name of the widget for each selected item, and the value of the form field will be the value of the item. This means that your model needs to expect a List of values for the given field.
The example also shows how you can get the selected values with JavaScript so you can use them to craft your own query in case you have more specific requirements.
You can read more about this in the [Submit MultiSelect Data to Controller POST](https://docs.telerik.com/aspnet-core/knowledge-base/multiselect-post-data-values) Knowledge Base article.
# aspnet-core-examples
A collection of Telerik UI for ASP.NET Core examples
- The sample ASP.NET Core projects are provided to demonstrate different frequently asked questions, features and scenarios.
- They are not part of our testing procedures and should be regarded as a knowledge base.
- Projects are tested only upon creation as well as when updating or upgrading the project.
- Mandatory prerequisite is to have installed ASP.NET Core 3.0
To run the projects from this repository:
1. Clone the repo
## Telerik.Examples.Mvc
1. Open the Telerik.Examples.Mvc.sln file in VS2019
2. Clean the solution
3. Build the solution and run the project.
4. Navigate to a certain example by adding the ControllerName/ActionMethod to the URL, i.e https://localhost:44361/ajaxbinding/ajaxbinding
> The project uses a local database which is created upon building the project based on the existent migrations.
## Telerik.Examples.RazorPages
1. Open the Telerik.Examples.RazorPages.sln file in VS2019
2. Clean the solution
3. Build the solution and run the project.
4. Navigate to a certain example by adding the PageFolder/ViewName to the URL, i.e https://localhost:44361/grid/gridcustomdatasource
## Additional Example Notes
The following section aims to provide additional information or important notes regarding specific examples.
### Telerik.Examples.Mvc
##### Editor/EditorContent
This project demonstrates how you can add, read, edit and delete text data using a local database and the Editor component
> Please note that the current project doesn't have any XSS attack preventions applied. It is a developer's responsibility to manage these security risks. For more information, please refer to this [Preventing Cross-Site Scripting](https://docs.telerik.com/kendo-ui/controls/editors/editor/preventing-xss) article.
##### MultiSelect/GetPostData
The MultiSelect is a `<select multiple>` element and behaves like one in a POST query - the browser will add a form data field with the name of the widget for each selected item, and the value of the form field will be the value of the item. This means that your model needs to expect a List of values for the given field.
The example also shows how you can get the selected values with JavaScript so you can use them to craft your own query in case you have more specific requirements.
You can read more about this in the [Submit MultiSelect Data to Controller POST](https://docs.telerik.com/aspnet-core/knowledge-base/multiselect-post-data-values) Knowledge Base article.

Просмотреть файл

@ -1,22 +1,26 @@
@{
ViewData["Title"] = "Home Page";
}
@model IEnumerable<string>
<h2 class="text-center">Navigate to an example of your choice</h2>
<ul>
@foreach (var item in Model)
{
if (@item.EndsWith("cshtml"))
{
var name = @item.Split(".")[0];
var href = "/" + name + "/" + name;
<li><a href="@href">@name</a> </li>
}
else
{
<li style="margin-top: 30px;"><h4>@item</h4></li>
}
}
</ul>
@{
ViewData["Title"] = "Home Page";
}
@model IEnumerable<string>
<h2 class="text-center">Navigate to an example of your choice</h2>
<p>The Telerik.Examples.Mvc project is comprised of a number of pages that aim to depict a certain functionality or behavior of the different Telerik UI components.</p>
<ul>
@foreach (var item in Model)
{
if (@item.EndsWith("cshtml"))
{
var name = @item.Split(".")[0];
var href = "/" + name + "/" + name;
<li><a href="@href">@name</a> </li>
}
else
{
<li style="margin-top: 30px;"><h4>@item</h4></li>
}
}
</ul>

Просмотреть файл

@ -1,29 +1,26 @@
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
<h2 class="text-center">Navigate to an example of your choice</h2>
<ul>@{string directoryName = ""; }
@foreach (var item in Model.fileNames)
{
if (@item.EndsWith("cshtml"))
{
var name = @item.Split(".")[0];
var href = "/" + directoryName + "/" + name;
<li><a href="@href">@name</a> </li>
}
else
{
directoryName = @item;
<li style="margin-top: 30px;"><h4>@item</h4></li>
}
}
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<h1 class="text-center">Navigate to an example of your choice</h1>
<p>The Telerik.Examples.RazorPages project is comprised of a number of pages that aim to depict a certain functionality or behavior of the different Telerik UI components.</p>
<ul>@{string directoryName = ""; }
@foreach (var item in Model.fileNames)
{
if (@item.EndsWith("cshtml"))
{
var name = @item.Split(".")[0];
var href = "/" + directoryName + "/" + name;
<li><a href="@href">@name</a> </li>
}
else
{
directoryName = @item;
<li style="margin-top: 30px;"><h4>@item</h4></li>
}
}
</ul>