Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!