mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Initial state
This commit is contained in:
24
samples/react/ReactGrid/Controllers/HomeController.cs
Executable file
24
samples/react/ReactGrid/Controllers/HomeController.cs
Executable file
@@ -0,0 +1,24 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.NodeServices.React;
|
||||
|
||||
namespace ReactExample.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public async Task<IActionResult> Index(int pageIndex)
|
||||
{
|
||||
ViewData["ReactOutput"] = await ReactRenderer.RenderToString(
|
||||
moduleName: "ReactApp/components/ReactApp.jsx",
|
||||
exportName: "ReactApp",
|
||||
baseUrl: Request.Path
|
||||
);
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View("~/Views/Shared/Error.cshtml");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user