c# - The requested URL returned 500 - Internal Server Error -
i'm having problems in project asp.net mvc razor using kendo-grid. data model following:
public partial class usuario { private string _id; public virtual string id { { return this._id; } set { this._id = value; } } private string _idperfil; public virtual string idperfil { { return this._idperfil; } set { this._idperfil = value; } } private string _identidad; public virtual string identidad { { return this._identidad; } set { this._identidad = value; } } private int? _iddeparea; public virtual int? iddeparea { { return this._iddeparea; } set { this._iddeparea = value; } } private char _forzarcambioclave; public virtual char forzarcambioclave { { return this._forzarcambioclave; } set { this._forzarcambioclave = value; } } private short? _iddirectivaseguridad; public virtual short? iddirectivaseguridad { { return this._iddirectivaseguridad; } set { this._iddirectivaseguridad = value; } } private string _hash; public virtual string hash { { return this._hash; } set { this._hash = value; } } private char _requiererol; public virtual char requiererol { { return this._requiererol; } set { this._requiererol = value; } } private string _idestado; public virtual string idestado { { return this._idestado; } set { this._idestado = value; } } private long _idpersona; public virtual long idpersona { { return this._idpersona; } set { this._idpersona = value; } } private estado _estado; public virtual estado estado { { return this._estado; } set { this._estado = value; } } private directivaseguridad _directivaseguridad; public virtual directivaseguridad directivaseguridad { { return this._directivaseguridad; } set { this._directivaseguridad = value; } } private entidad _entidade; public virtual entidad entidad { { return this._entidade; } set { this._entidade = value; } } private persona _persona; public virtual persona persona { { return this._persona; } set { this._persona = value; } } private ilist<rol> _roles = new list<rol>(); public virtual ilist<rol> roles { { return this._roles; } } private ilist<logmasterauditoria> _logsmasterauditoria = new list<logmasterauditoria>(); public virtual ilist<logmasterauditoria> logsmasterauditoria { { return this._logsmasterauditoria; } } }
controller managing model is:
public class usuarioscontroller : basecontroller { private usuario usuario = new usuario(); public actionresult cargar([datasourcerequest]datasourcerequest request) { return json(backend.usuarios.todatasourceresult(request)); }
... }
view is:
<div> @(html.kendo().grid<netinfinity.backendcore.usuario>() .name("grid") .columns(columns => { columns.bound(c => c.id).filterable(false).width(100).title(@usuarios.id); columns.bound(c => c.persona.nombres).width(80).title(@usuarios.nombre); columns.bound(c => c.estado.descripcion).width(60).title(@usuarios.nombreperfil); columns.bound(c => c.persona.tipoidentidad.formatopresentacion).width(20).title(@usuarios.idtipo); columns.bound(c => c.persona.numeroidentificacion).width(30).title(@usuarios.idnumero); columns.command(c => c.custom("edit").text("editar")); columns.command(c => c.custom("remove").text("eliminar")); }) .toolbar(t => { t.excel(); }) .navigatable() .pageable() .sortable() .scrollable() .filterable() .editable(e => e.mode(grideditmode.popup)) .resizable(resize => resize.columns(true)) .htmlattributes(new { style = "height:430px;" }) .datasource(datasource => datasource .ajax() .serveroperation(false) .model(model => model.id(c => c.id)) .read(read => read.action("cargar", "usuarios")) ) ) </div>
problem seems raises when json serialization controller executed because no data shown grid , table has rows. maybe there problem serializing objects model virtual properties, eg: virtual persona object , others. please need on how put work.
have tried debug , exception message + stack trace detect error? debugger tool avoid "maybe". moreover, asp.net should return error description if such config has been turned on in web.config.
please, find error debugging , post exception details here.
or change web.config
such have following value:
<configuration> <system.web> <customerrors mode="off" /> </system.web> </configuration>
refresh page , error's description.
detect error , fix or post here , you.
Comments
Post a Comment