From 0ef09b334c0c70c83690cbbea2fb49805e21ccf0 Mon Sep 17 00:00:00 2001 From: Tracy Pearson Date: Sat, 10 Dec 2022 17:01:11 -0500 Subject: [PATCH] Functioning partial view usings ajax --- Caddy/Caddyfile | 1 + WebPostPartialJsonObject/Controllers/HomeController.cs | 9 --------- .../Controllers/SettingsController.cs | 8 ++++++++ WebPostPartialJsonObject/Properties/launchSettings.json | 2 +- WebPostPartialJsonObject/Views/Settings/Index.cshtml | 4 ++-- .../Views/{Home => Settings}/ReprintView.cshtml | 3 ++- 6 files changed, 14 insertions(+), 13 deletions(-) rename WebPostPartialJsonObject/Views/{Home => Settings}/ReprintView.cshtml (71%) diff --git a/Caddy/Caddyfile b/Caddy/Caddyfile index 86058f5..66dc0a1 100644 --- a/Caddy/Caddyfile +++ b/Caddy/Caddyfile @@ -6,6 +6,7 @@ time_format wall_milli duration_format string } + level debug } } diff --git a/WebPostPartialJsonObject/Controllers/HomeController.cs b/WebPostPartialJsonObject/Controllers/HomeController.cs index e8fbbe8..0552387 100644 --- a/WebPostPartialJsonObject/Controllers/HomeController.cs +++ b/WebPostPartialJsonObject/Controllers/HomeController.cs @@ -29,15 +29,6 @@ namespace WebPostPartialJsonObject.Controllers HttpContext.Session.SetObject("KioskSettings", data); return RedirectToAction("Index", "Settings"); } - [HttpPost] - public IActionResult Reprint([FromForm]int ckinid) - { - ReprintInfo model = new ReprintInfo(); - model.CkInId = ckinid; - model.PrinterName = "printer"; - return PartialView("ReprintView", model); - } - public IActionResult Privacy() { return View(); diff --git a/WebPostPartialJsonObject/Controllers/SettingsController.cs b/WebPostPartialJsonObject/Controllers/SettingsController.cs index a3a9512..b812f0d 100644 --- a/WebPostPartialJsonObject/Controllers/SettingsController.cs +++ b/WebPostPartialJsonObject/Controllers/SettingsController.cs @@ -11,5 +11,13 @@ namespace WebPostPartialJsonObject.Controllers ExpectedViewModel data = HttpContext.Session.GetObject("KioskSettings"); return View(data); } + [HttpPost] + public IActionResult Reprint([FromForm] int ckinid) + { + ReprintInfo model = new ReprintInfo(); + model.CkInId = ckinid; + model.PrinterName = "printer"; + return PartialView("ReprintView", model); + } } } diff --git a/WebPostPartialJsonObject/Properties/launchSettings.json b/WebPostPartialJsonObject/Properties/launchSettings.json index 5b7cba8..78bc682 100644 --- a/WebPostPartialJsonObject/Properties/launchSettings.json +++ b/WebPostPartialJsonObject/Properties/launchSettings.json @@ -18,7 +18,7 @@ "WebPostPartialJsonObject": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://localhost:5000", + "applicationUrl": "http://+:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/WebPostPartialJsonObject/Views/Settings/Index.cshtml b/WebPostPartialJsonObject/Views/Settings/Index.cshtml index 941c3df..75f1aa1 100644 --- a/WebPostPartialJsonObject/Views/Settings/Index.cshtml +++ b/WebPostPartialJsonObject/Views/Settings/Index.cshtml @@ -26,7 +26,7 @@ -