In Asp.Net MVC, you can easily return a partial view by doing the following:
return PartialView(\"ModelName\", Model);
How is this done on a Raz
Thanks alot to TechFisher for figuring it out, here is a bit cleaner example.
public IActionResult OnGetTestPartial()
{
return new PartialViewResult()
{
ViewName = "Test",
ViewData = new ViewDataDictionary(new EmptyModelMetadataProvider(), new ModelStateDictionary())
{
Model = new TestPartialData { Data = "inputhere" },
}
};
}
Partial view in a file name "Test.cshtml" in the same folder as the above class.
@using YourNamespace
@model TestPartialData
Hello, model value: @Model.Data
Load it async with jquery
$("#someHtmlElementId").load("Your/Path/TestPartial");