By default razor takes the modified input name name why? RRS feed

  • Question

  • User1052662409 posted

    Hi All,

    Here I have no issue but just a clarification to know about the name property of input.

    Below is my an input field.

    @Html.TextBox("proname", Model.vendorsModels[i].name, new { @name = "proname", @class = "form-control" })

    As we all are known that if we bind a model property to an input, the property becomes its name.

    So according to my above code, that name of input should be "name". But as you would have noticed that I also provided the "proname" as name (@name = "proname").

    So when I run my code so it takes "proname" as the name of input instead of "name".


    Friday, May 1, 2020 7:46 AM


All replies