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

235
Visualizações
Webhook method data to partial view - not possible?

I'm purposely not going to post code unless asked because we have all seen Return View("PartialView").

I have a webhook receiver method in my home controller to get responses from Square. All works as expected and I am able to receive the payload data without issue.

The problem that has been plaguing me for the last 3 days is the fact that at the end on the webhook method, there is the return View("PartialView"), but no TempData, ViewBag or Model is anything but null in the partial view that is indeed called.

I am beginning to surmise that because the call the the webhook method is coming from the outside world that return View("partial")'s various view data facilities break.

I can set ViewBag.WebHookData to "come on man"; and it's still null over in the partial view as if there are redirects. And model data which is supposed to be implicitly carried across to the partial view and Tempdata don't fare any better and are null.

I can find lots of "how do you make a web hook" google returns but not how to display webhook payload on the current view.

What do you veterans think?

Addendumb: The webhhook method is async Task fwiw. That means it's running in a different thread than the single threaded js in the view?

TIA

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

There I fixed it. :-)

The only thing that would work (not be null) was a public static string of square status over in the controller accessed via razor in the view. But it wasn't dynamic, for days..... Then I gave signalR a whirl (again) promising, no pun intended, to stick with it until I had got it working. I had always given up on it as to do what it was intended to do, dynamic web page update seemed fiddly and complex. But alas, desperate times called for patience and lo, it's working now. Square webhook status is now dynamically posted in a status area of the sales screen as point of sale events occur.

I know public static variables are frowned upon but it was the only thing that worked.

about 4 years ago · Juan Pablo Isaza 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