asp.net - Disable validation for Kendo DropDownListFor -


in asp.net mvc 4 application have dropdownlistfor show favourites list. field no required submit form. dropdownlistfor data master data table. thing when submit , haven't choose favourite list, not able disable valildation. kendo dropdownlistfor code:

    @{ ilist<repsol.portal.portalclientedeac.glp.domain.entities.pedidofavorito> cmbfavorito = listapedidofavorito.tolist();  }  @(html.kendo().dropdownlistfor(model => model.pedidofavorito.idfavorito)                     .bindto(new selectlist(cmbfavorito.select(s => new { key = s.idfavorito, value = s.descfavorito }), "key", "value"))                     .name("idfavorito")                     .optionlabel(idioma.shared.pedidos_seleccioneopcion)                     ) 

this content of class pedidofavorito.cs:

public partial class pedidofavorito {     #region primitive properties      public virtual int idfavorito     {         get;         set;     }      public virtual string idcontrato     {         get;         set;     }      public virtual string idpedido     {         get;         set;     }      public virtual string descfavorito     {         get;         set;     }      public virtual string metadata     {         get;         set;     }      #endregion  } 

i've tried many things without positive result.

thanks in advance!!

the data annotation render data-val-required, because descfavorito property non-nullable.

take @ this link


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -