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

145
Visualizações
How to read a c# server side value in jquery

I've a JArray response value like below

{[
  {
    "id": "90b254dc-3fcd-4e7c-9943-59bce366ccdc",
    "invoice_number": "510002500007368" 
  }
]}

i'm getting this value from c# class ..when I try to read in jQuery like below ways

  var tmp = '@Model.Transactions';
    var tmp = Model.Transactions;
    var tmp = @Model.Transactions;

from that I'm getting the values like below image ... i need a structured values. let me know if any idea.. thanks

Response Value Image

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

0

You need to render it in a "raw" manner like this, without escaping or encoding so it will remaing "correct" JSON:

var tmp = @:Model.Transactions;

You can also for example prepare your JSON string in the controller e.g. Model.MyJson then use @:Model.MyJson in the view (notice : after @).

This is shortcut for @Html.Raw(myJson);

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