Controls Optimization

Each Mvc Controls Toolkit control write an hidden filed containing "hints" to be used by the model binder to bind properly the information posted by the control (see here and here for more information on how mvc controls work). 

When a page contains several control, for instance, within the rows of a grid or the nodes of a TreeView, the total space of all these hidden fileds may impact the application performance. 

The Html.OpenTContext() and Html.CloseTContext() helpers "compact" all hidden fields contained between them. Typically Html.OpenTContext()  is inserted at the beginning of a form and Html.CloseTContext() at the end of the same form, so that all of the "model binder hints" contained in that form are compacted.

An example of their use is reported in the example that comes with the binary distribution contained in the BinariesWithSimpleExamples file of the download area.

Last edited Jun 22, 2014 at 10:39 AM by frankabbruzzese, version 3


No comments yet.