Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

234
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda