Current filter:
                                You should refresh the page.
                                  • Description:
                                    How to use the ClientInstanceName and Name properties when they contain special characters

                                    Answer:
                                    How to use the ClientInstanceName and Name properties when they contain special characters
                                    If:
                                    - The control ClientInstanceName property (for ASP.NET WebForms);
                                    - The extension Name property (for ASP.NET MVC)
                                    contains any special characters (for example, the "." dot) it is necessary to access the client-side programmatic object in the following manner (instead of using the real value with the special character):

                                    1. Retrieve the client-side programmatic object via the client-side ASPxClientControl().GetControlCollection().GetByName method;
                                    2. Use the retrieved object to get access to the corresponding ASPxClient*** type API:
                                    [JavaScript]
                                    var txt = ASPxClientControl.GetControlCollection().GetByName("SomeType.SomeProp"); txt.SetText("Some Text");

                                    ASP.NET WebForms:

                                    [ASPx]
                                    <dx:ASPxTextBox ... ClientInstanceName="SomeType.SomeProp"> </dx:ASPxTextBox>

                                    ASP.NET MVC:

                                    [C#]
                                    @Html.DevExpress().TextBox(settings => { settings.Name = "SomeType.SomeProp"; }).GetHtml()

                                    This technique can also be used to implement namespaces on the client side - specify client names with dots and then obtain instances using the aforementioned approach. This will help to keep your code more maintainable.

                                0 Solutions

                                Creation Date Importance Sort by