Dot in GET & POST request data name (ASP.net MVC)

ASP.net MVC TryUpateModel or UpdateModel will automatically bind the HTTP request (form and query string) as an object property using a dot.

For example, it <input type="text" name="Person.first_name">

can automatically bind to a Person.first_name object

The problem is that the dot in the query string and the form might cause an unknown problem in the future. Anyway, I can replace this dot separator with another character like "-" etc.

+2


source to share


1 answer


Passing your dotted ID in the Html attributes will do what you want in the default POST messages, at least

Kindness,



Dan

<%=Html.TextBox("some.thing", "", new { id = "some.thing" })%>

      

0


source







All Articles