Unplanned
Last Updated: 14 Jun 2021 14:38 by ADMIN
Jon
Created on: 08 Jul 2020 09:01
Category: TextBox
Type: Feature Request
3
Create TextBox Label from ViewModel Data Annotation

Feature Request

Create TexBox label from ViewModel Data Annotation

Currently, this is possible using the default @Html.Label, and @Html.Textbox

-Model:

     [DisplayName("First Name :")]

public string FirstName { get; set; }

-View

        <tr>
         <td>
                @ Html.LabelFor(m=>m.FirstName)
            </td>
            <td>
                @Html.TextBoxFor(m=>m.FirstName)                
            </td>
        </tr>

2 comments
ADMIN
Tsvetomir
Posted on: 14 Jun 2021 14:38

Hi, Murat,

Thank you for your proposal. As I could see it has already been approved and is a valid idea. However, it has not yet slipped into the planning for the consequent release cycles.

As a temporary workaround, I would suggest sticking to the Html.LabelFor HtmlHelper for setting the label for the respective editor. Indeed, it does not come from the options from the TextBox, however, you would be able to achieve exactly the same functionality.

 

Best regards,
Tsvetomir
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Jon
Posted on: 08 Jun 2021 08:53

This function is helpful. please implement it

for example like this

@Html.Kendo().TextBoxFor(model => model.Name).Label(l => l.Content(Model.Name).Floating(true))

 

Thank you and best regards