Back to Devexpress

SettingsBase.Name Property

aspnetmvc-devexpress-dot-web-dot-mvc-dot-settingsbase.md

latest7.9 KB
Original Source

SettingsBase.Name Property

Specifies the unique identifier name for the extension.

Namespace : DevExpress.Web.Mvc

Assembly : DevExpress.Web.Mvc5.v25.2.dll

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public string Name { get; set; }
vb
Public Property Name As String

Property Value

TypeDescription
String

The extension name.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to Name
MVCxFormLayoutItem

.NestedExtensionSettings .Name

|

Remarks

The extension name defined by the Name property can be used to access the extension client object on the client side.

js
var tbValue;
function preserveTextBoxValue(){
    tbValue = textBox1.GetText();
}
csharp
@Html.DevExpress().TextBox(
    settings => {
        settings.Name = "textBox1";
        settings.Text = "some text";
    }
).GetHtml()

Special Characters in the Name

If the Name property contains special characters, for instance, the dot (.), you cannot access a client object by this name. Call the GetByName(name) method to retrieve the client-side object instead.

csharp
@Html.DevExpress().TextBox(settings => {  
    settings.Name = "SomeType.SomeProp";  
}).GetHtml()
js
var txt = ASPxClientControl.GetControlCollection().GetByName("SomeType.SomeProp");  
txt.SetText("Some Text");

For more information, see the Client-Side API help topic.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Name property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-mvc-grid-export-multiple-gridviews-into-a-document/CS/Controllers/HomeController.cs#L27

csharp
GridViewSettings categoriesGridSettings = new GridViewSettings();
categoriesGridSettings.Name = "gvCategories";
categoriesGridSettings.KeyFieldName = "CategoryID";

asp-net-mvc-scheduler-fetch-appointment-event/CS/DevExpressMvcSchedulerFetchAppointments/Models/SchedulerSettingsHelper.cs#L22

csharp
SchedulerSettings settings = new SchedulerSettings();
settings.Name = "scheduler";
settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" };

asp-net-mvc-grid-export-colored-grid-in-wysiwyg-mode/CS/Controllers/HomeController.cs#L44

csharp
settings.Name = "gvProducts";
settings.CallbackRouteValues = new { Controller = "Home", Action = "GridViewPartialProducts" };

asp-net-mvc-spell-checker-customize-built-in-dialogs/CS/SpellCheckerCustomDialogs/Helpers/SpellCheckerHelper.cs#L26

csharp
SpellCheckerSettings settings = new SpellCheckerSettings();
settings.Name = "SpellChecker";
settings.CallbackRouteValues = new { Action = "IndexPartial", Controller = "Home" };

how-to-customize-the-appointment-dialog-using-view-model-api-working-with-custom-fields-t582020/CS/DevExpressMvcApplication1/Models/SchedulerDataHelper.cs#L105

csharp
SchedulerSettings settings = new SchedulerSettings();
settings.Name = "scheduler";
settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" };

asp-net-mvc-grid-export-multiple-gridviews-into-a-document/VB/Controllers/HomeController.vb#L32

vb
Dim categoriesGridSettings As New GridViewSettings()
categoriesGridSettings.Name = "gvCategories"
categoriesGridSettings.KeyFieldName = "CategoryID"

asp-net-mvc-scheduler-fetch-appointment-event/VB/DevExpressMvcSchedulerFetchAppointments/Models/SchedulerSettingsHelper.vb#L20

vb
Dim settings As New SchedulerSettings()
settings.Name = "scheduler"
settings.CallbackRouteValues = New With {Key .Controller = "Home", Key .Action = "SchedulerPartial"}

asp-net-mvc-grid-export-colored-grid-in-wysiwyg-mode/VB/Controllers/HomeController.vb#L51

vb
settings.Name = "gvProducts"
settings.CallbackRouteValues = New With {Key .Controller = "Home", Key .Action = "GridViewPartialProducts"}

asp-net-mvc-spell-checker-customize-built-in-dialogs/VB/SpellCheckerCustomDialogs_vb/Helpers/SpellCheckerHelper.vb#L28

vb
Dim settings As New SpellCheckerSettings()
settings.Name = "SpellChecker"
settings.CallbackRouteValues = New With {Key .Action = "IndexPartial", Key .Controller = "Home"}

how-to-customize-the-appointment-dialog-using-view-model-api-working-with-custom-fields-t582020/VB/DevExpressMvcApplication1/Models/SchedulerDataHelper.vb#L110

vb
Dim settings As New SchedulerSettings()
settings.Name = "scheduler"
settings.CallbackRouteValues = New With {Key .Controller = "Home", Key .Action = "SchedulerPartial"}

See Also

Client-Side Functionality

Online Demo: TreeView - Client-Side Functionality

SettingsBase Class

SettingsBase Members

DevExpress.Web.Mvc Namespace