asp.net mvc: Index was out of range exception in jQuery -



asp.net mvc: Index was out of range exception in jQuery -

in jquery need have this:

if (@(model.listitems.count) > 0) if ('@(model.listitems[0].date)' != '') .......

which when model.listitems.count 0 won't work, throws

index out of range

exception in next line. makes sense deed this, because of evaluation of expressions, can deed intend?

i have figured out: code becomes:

@if (model.listitems.count > 0) { if (model.listitems[0].date!= null) <text> ...... </text> }

jquery asp.net-mvc exception

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -