Functional partialview via ajax

This commit is contained in:
Tracy Pearson
2022-12-10 02:51:51 -05:00
parent 57946e64d5
commit 075283f884
5 changed files with 37 additions and 11 deletions

3
.gitignore vendored
View File

@@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
Caddy/*
!Caddyfile
# User-specific files
*.rsuser
*.suo

15
Caddy/Caddyfile Normal file
View File

@@ -0,0 +1,15 @@
{
log {
output stderr
format json {
time_local
time_format wall_milli
duration_format string
}
}
}
http://*:9000 {
reverse_proxy localhost:5000
log
}

View File

@@ -29,10 +29,13 @@ namespace WebPostPartialJsonObject.Controllers
HttpContext.Session.SetObject("KioskSettings", data);
return RedirectToAction("Index", "Settings");
}
[HttpPost, Consumes("application/json")]
public IActionResult Reprint(int ckinid)
[HttpPost]
public IActionResult Reprint([FromForm]int ckinid)
{
return PartialView("Reprint");
ReprintInfo model = new ReprintInfo();
model.CkInId = ckinid;
model.PrinterName = "printer";
return PartialView("ReprintView", model);
}
public IActionResult Privacy()

View File

@@ -1,5 +1,7 @@
using System.Collections;
using System.Collections.Generic;
namespace WebPostPartialJsonObject.Models
{
public class ReprintInfo
{
@@ -7,4 +9,6 @@ public class ReprintInfo
public IEnumerable<string> LabelNames { get; set; }
public int PrinterType { get; set; }
public string PrinterName { get; set; }
public int CkInId { get; set; }
}
}

View File

@@ -1,8 +1,9 @@
@*
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@model WebPostPartialJsonObject.Models.ReprintInfo
@{
}
<h1>Partial View</h1>
<h1>Partial View @Model.CkInId</h1>