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

  1. #1

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

    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.
    Last edited by Daniil; Aug 21, 2015 at 10:50 AM. Reason: Please use [VAR] tags
  2. #2
    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.

Similar Threads

  1. Replies: 7
    Last Post: Jan 20, 2015, 7:06 PM
  2. Replies: 1
    Last Post: May 13, 2013, 3:40 PM
  3. [CLOSED] Element got style="width:0px;" default
    By ViDom in forum 1.x Premium Help
    Replies: 13
    Last Post: Feb 04, 2013, 2:30 PM
  4. "Fields" property is missing inside JsonReader
    By teamsar in forum 2.x Help
    Replies: 0
    Last Post: Feb 01, 2013, 6:13 AM
  5. Replies: 3
    Last Post: Sep 24, 2012, 3:56 PM

Posting Permissions