Skip to content

947971: Ug Documentation for asp core and mvc features #4072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace EJ2CoreSampleBrowser.Controllers
{
public class HomeController : Controller
{
public ActionResult DateRange()
{
ViewBag.value = new DateTime(DateTime.Now.Year,DateTime.Now.Month,14);
return View();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@Html.EJS().DatePicker("element").Value(ViewBag.value).Format("yyyy-MM-dd").InputFormats(new string[] { "dd/MM/yyyy", "yyyyMMdd" }).Placeholder("Enter date").Render()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<ejs-datepicker id="datepicker" value="@ViewBag.value" format="yyyy-MM-dd" inputFormats="@(new string[] {"dd/MM/yyyy", "yyyyMMdd"})" placeholder="Enter date"></ejs-datepicker>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace EJ2CoreSampleBrowser.Controllers
{
public partial class HomeController : Controller
{
// GET: /<controller>/
public IActionResult DateTimeFormat()
{
ViewBag.value = new DateTime(DateTime.Now.Year,DateTime.Now.Month,14);
return View();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@Html.EJS().DateTimePicker("element").Value(ViewBag.value).Format("yyyy-MM-dd hh:mm").InputFormats(new string[] { "MM.dd.yyyy hh:mm a", "yyyy-MM-dd HH:mm" }).Placeholder("Enter date and time").Render()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<ejs-datetimepicker id="datetimepicker" value="@ViewBag.value" format="yyyy-MM-dd hh:mm" inputFormats="@(new string[] {"MM.dd.yyyy hh:mm a", "yyyy-MM-dd HH:mm"})" placeholder="Enter date and time"></ejs-datetimepicker>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebApplication1.Models
{
public class EmailData
{
public string Name { get; set; }
public string EmailId { get; set; }
public List<EmailData> EmailList()
{
List<EmailData> email = new List<EmailData>()
{
new EmailData { Name = "Selma Rose", EmailId = "[email protected]" },
new EmailData { Name = "Maria", EmailId = "[email protected]" },
new EmailData { Name = "Russo kay", EmailId = "[email protected]" },
new EmailData { Name = "Robert", EmailId = "[email protected]" },
new EmailData { Name = "Garth", EmailId = "[email protected]" }
};
return email;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@model List<string>
@{
List<EmailData> data = new EmailData().EmailList();
}

<div id="mentionElement" placeholder="Type @Html.Raw("mention") and tag user"></div>

@Html.EJS().Mention("Mention-Char-Customize").Target("#mentionElement").DataSource((IEnumerable<object>)data).Fields(new Syncfusion.EJ2.DropDowns.MentionFieldSettings { Text = "Name" }).RequireLeadingSpace(false).Render()

<style>

div#mentionElement[placeholder]:empty:before {
content: attr(placeholder);
}

#mentionElement{
min-height: 100px;
border: 1px solid #D7D7D7;
border-radius: 4px;
padding: 8px;
font-size: 14px;
width: 600px;
}

</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WebApplication1.Models;

namespace WebApplication1.Controllers
{
public class MentionController : Controller
{
public ActionResult Index()
{
return View();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@{
List<EmailData> data = new EmailData().EmailList();
}

<div id="mentionElement" placeholder = "Type @@ and tag user"></div>
<ejs-mention id="comments" dataSource="@data" target="#mentionElement" requireLeadingSpace="false" >
<e-mention-fields text="Name"></e-mention-fields>
</ejs-mention>

<style>

div#mentionElement[placeholder]:empty:before {
content: attr(placeholder);
}

#mentionElement{
min-height: 100px;
border: 1px solid #D7D7D7;
border-radius: 4px;
padding: 8px;
font-size: 14px;
width: 600px;
}

</style>
30 changes: 30 additions & 0 deletions ej2-asp-core-mvc/datepicker/date-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,33 @@ The following example demonstrates the DatePicker with the custom format (`yyyy-
{% endtabs %}
{% endif %}

## Input formats

The [`inputFormats`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Calendars.DatePicker.html#Syncfusion_EJ2_Calendars_DatePicker_InputFormats) property in the DatePicker control allows users to enter dates in various formats, providing flexibility in date entry. This property accepts an array of predefined formats that the control recognizes, enabling users to input dates in different ways while ensuring they are parsed correctly.

When the user types the date in any of the specified input formats, it will be automatically converted to the display format after pressing Enter, the Tab key, or when the input loses focus. This enhances the user experience by allowing intuitive data entry through various custom input formats.

The following example demonstrates the DatePicker with multiple input formats.

{% if page.publishingplatform == "aspnet-core" %}

{% tabs %}
{% highlight cshtml tabtitle="CSHTML" %}
{% include code-snippet/datepicker/input-format/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="Date-format.cs" %}
{% include code-snippet/datepicker/input-format/input-format.cs %}
{% endhighlight %}
{% endtabs %}

{% elsif page.publishingplatform == "aspnet-mvc" %}

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/datepicker/input-format/razor %}
{% endhighlight %}
{% highlight c# tabtitle="Date-format.cs" %}
{% include code-snippet/datepicker/input-format/input-format.cs %}
{% endhighlight %}
{% endtabs %}
{% endif %}
32 changes: 31 additions & 1 deletion ej2-asp-core-mvc/datetimepicker/date-time-format.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
title: Date Time Format in ##Platform_Name## Datetimepicker Component
title: Date Time Format in ##Platform_Name## Datetimepicker Component | Syncfusion
description: Learn here all about Date Time Format in Syncfusion ##Platform_Name## Datetimepicker component of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: Date Time Format
Expand Down Expand Up @@ -44,3 +44,33 @@ The following example demonstrates the DateTimePicker with the custom format (`y
{% endtabs %}
{% endif %}

## Input formats

The [`inputFormats`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Calendars.DateTimePicker.html#Syncfusion_EJ2_Calendars_DateTimePicker_InputFormats) property in the DatetimePicker control allows users to enter dates and times in various formats, providing flexibility in date and time entry. This property accepts an array of predefined formats that the control recognizes, enabling users to input dates in different ways while ensuring they are parsed correctly.

When the user types the date and time in any of the specified input formats, it will be automatically converted to the display format after pressing Enter, the Tab key, or when the input loses focus. This enhances the user experience by allowing intuitive data entry through various custom input formats.

The following example demonstrates the DateTimePicker with multiple input formats.

{% if page.publishingplatform == "aspnet-core" %}

{% tabs %}
{% highlight cshtml tabtitle="CSHTML" %}
{% include code-snippet/datetimepicker/input-format/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="Input-format.cs" %}
{% include code-snippet/datetimepicker/input-format/input-format.cs %}
{% endhighlight %}
{% endtabs %}

{% elsif page.publishingplatform == "aspnet-mvc" %}

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/datetimepicker/input-format/razor %}
{% endhighlight %}
{% highlight c# tabtitle="Input-format.cs" %}
{% include code-snippet/datetimepicker/input-format/input-format.cs %}
{% endhighlight %}
{% endtabs %}
{% endif %}
21 changes: 19 additions & 2 deletions ej2-asp-core-mvc/mention/EJ2_ASP.MVC/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Customization in ASP.NET MVC Mention control | Syncfusion
description: Learn here all about customization in Syncfusion ASP.NET MVC Mention control of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: Customization
publishingplatform: ejmvc
publishingplatform: ##Platform_Name##
documentation: ug
---

Expand Down Expand Up @@ -59,4 +59,21 @@ By default, the popup list width value is set as `auto`. Depending on the mentio

You can customize the trigger character by using the [MentionChar](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.DropDowns.Mention.html#Syncfusion_EJ2_DropDowns_Mention_MentionChar) property in the Mention control. The trigger character triggers the suggestion list to display in the target area.

By default, the [MentionChar](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.DropDowns.Mention.html#Syncfusion_EJ2_DropDowns_Mention_MentionChar) is `@`.
By default, the [MentionChar](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.DropDowns.Mention.html#Syncfusion_EJ2_DropDowns_Mention_MentionChar) is `@`.

## Leading Space Requirement

The [RequireLeadingSpace](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.dropdowns.mention.html#Syncfusion_EJ2_DropDowns_Mention_RequireLeadingSpace) property in Mention controls whether a space is needed before triggering the Mention suggestion popup.

When set to `false`, the mention can be activated without a preceding space. When set to `true`, a space is required before the mention character to activate suggestions.

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/mention/customization/require-leading-space/razor %}
{% endhighlight %}
{% highlight c# tabtitle="Data.cs" %}
{% include code-snippet/mention/customization/require-leading-space/EmailData.cs %}
{% endhighlight %}
{% endtabs %}

![ASP.NET MVC Require Leading Space](./images/required_leading_space.gif)
21 changes: 19 additions & 2 deletions ej2-asp-core-mvc/mention/EJ2_ASP.NETCORE/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Customization in ASP.NET Core Mention control | Syncfusion
description: Learn here all about customization in Syncfusion ASP.NET Core Mention control of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: Customization
publishingplatform: aspnet-core
publishingplatform: ##Platform_Name##
documentation: ug
---

Expand Down Expand Up @@ -59,4 +59,21 @@ By default, the popup list width value is set as `auto`. Depending on the mentio

You can customize the trigger character by using the [mentionChar](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DropDowns.Mention.html#Syncfusion_EJ2_DropDowns_Mention_MentionChar) property in the Mention control. The trigger character triggers the suggestion list to display in the target area.

By default, the [mentionChar](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DropDowns.Mention.html#Syncfusion_EJ2_DropDowns_Mention_MentionChar) is `@`.
By default, the [mentionChar](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DropDowns.Mention.html#Syncfusion_EJ2_DropDowns_Mention_MentionChar) is `@`.

## Leading Space Requirement

The [requireLeadingSpace](https://help.syncfusion.com/cr/aspnetmvc-js2/syncfusion.ej2.dropdowns.mention.html#Syncfusion_EJ2_DropDowns_Mention_RequireLeadingSpace) property in Mention controls whether a space is needed before triggering the Mention suggestion popup.

When set to `false`, the mention can be activated without a preceding space. When set to `true`, a space is required before the mention character to activate suggestions.

{% tabs %}
{% highlight cshtml tabtitle="CSHTML" %}
{% include code-snippet/mention/customization/require-leading-space/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="Data.cs" %}
{% include code-snippet/mention/customization/require-leading-space/EmailData.cs %}
{% endhighlight %}
{% endtabs %}

![ASP.NET Core Mention Required Leading Space](./images/required_leading_space.gif)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.