Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

257
Visualizações
MVC and Javascript to test for a null value in javascript

I am using MVC .net core to populate my ViewModel. I am trying to build a chart and a canvas is not being created if the value is null. This is working fine.

regardless if I add a test in the script section to test for null

if (Model.AssessmentDetailByCategChart!= null) 
{

or testing for element exists (and it should not )

if ($('#canvasRadarTech').length > 0) {

I have this crash. Could you please help with the proper syntax?

enter image description here

enter image description here

If I add a "@" in front of the model, then the rest of the code is not compiling. enter image description here

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

use @if to test values in Model

@if (Model.AssessmentDetailByCategChart!= null) 
{
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda