Back to Devexpress

SettingsBase.Name Property

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

latest7.8 KB
Original Source

SettingsBase.Name Property

Gets or sets the unique identifier name for the extension.

Namespace : DevExpress.Web.Mvc

Assembly : DevExpress.Web.Mvc5.v20.1.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.

Example

View code (ASPX):

csharp
...
<script type="text/javascript">
    var tbValue;

    function preserveTextBoxValue(){
        tbValue = textBox1.GetText();
    }
</script>

...

        <% 
            Html.DevExpress().TextBox(
                settings => {
                    settings.Name = "textBox1";
                    settings.Text = "some text";
                }
            )
            .Render();
        %>

View code (Razor):

csharp
...
<script type="text/javascript">
    var tbValue;

    function preserveTextBoxValue(){
        tbValue = textBox1.GetText();
    }
</script>

...

        @Html.DevExpress().TextBox(
            settings => 
            {
                settings.Name = "textBox1";
                settings.Text = "some text";
            }
        ).GetHtml()

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

Note

If the Name property contains special characters, use the approach described in the following Knowledge Base Article to access the client-side programmatic object.

KA18687: How to use the ClientInstanceName and Name properties when they contain special characters

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";

mvc-gridview-export-data-to-different-formats/CS/Controllers/HomeController.cs#L56

csharp
settings.Name = "gvTypedListDataBinding";
settings.CallbackRouteValues = new { Controller = "Home", Action = "TypedListDataBindingPartial" };

asp-net-mvc-grid-export-hide-and-add-columns/CS/E4915/Controllers/HomeController.cs#L30

csharp
GridViewSettings settings = new GridViewSettings();
settings.Name = "GridView";
settings.CallbackRouteValues = new {

asp-net-mvc-scheduler-use-checkboxlist-to-filter-resources/CS/Code/SchedulerHelper.cs#L20

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

asp-net-mvc-scheduler-appointment-edit-form/CS/Code/SchedulerHelper.cs#L21

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"

mvc-gridview-export-data-to-different-formats/VB/Controllers/HomeController.vb#L52

vb
Dim settings As GridViewSettings = New GridViewSettings()
settings.Name = "gvTypedListDataBinding"
settings.CallbackRouteValues = New With {.Controller = "Home", .Action = "TypedListDataBindingPartial"}

asp-net-mvc-grid-export-hide-and-add-columns/VB/E4915/Controllers/HomeController.vb#L34

vb
Dim settings As New GridViewSettings()
settings.Name = "GridView"
settings.CallbackRouteValues = New With {Key .Controller = "Home", Key .Action = "GridViewPartial"}

asp-net-mvc-scheduler-use-checkboxlist-to-filter-resources/VB/Code/SchedulerHelper.vb#L25

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

asp-net-mvc-scheduler-appointment-edit-form/VB/Code/SchedulerHelper.vb#L24

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

See Also

Client-Side API

Online Demo: TreeView - Client-Side Functionality

SettingsBase Class

SettingsBase Members

DevExpress.Web.Mvc Namespace