PDA

View Full Version : Ext.Net.MVC: How to prevent default field Id with "For" suffixed fields?



Yury
Jul 08, 2015, 6:33 PM
Hello,

Fields with "For" suffix like TextFieldFor, DisplayFieldFor set id which equals model field name. It isn't comfortable because I have 2 different forms with identical models on one page (I see controls only from one form because elements in dom model should have unique id).

I've found the solution: Html.X().DisplayFieldFor(m => m.Name).ID(""), but empty id looks very unclear.

Is there a better solution to override field ID?

Edited

I've found default parameter setId = true. It would be nice if default value will be false.

Daniil
Aug 21, 2015, 10:51 AM
Hi Yury,

A related issue:
https://github.com/extnet/Ext.NET/issues/271


I've found default parameter setId = true. It would be nice if default value will be false.

I tend to agree, but it would be quite a breaking change if do that now. Not sure we will change it.