0

I'm looking at how to convert simple tasks into Blazer Server (.NET Core 3.1). Say, submitting an order form to an external server or a subscription request via POST.

All I can find is related to the Navigation Manager, but this only does a GET.

@inject NavigationManager navManager

This doesn't allow me to POST. How can I achieve that?

To be clear, the order gets validated on the server and then a POST is issued to the client to continue processing the request elsewhere.

The way I was doing it with ASP.NET Core Razor Pages is a PayPalFormProcessor class was returning raw HTML containing a FORM POST, and it was rendered to the client using a custom TextActionResult class.

So the real question would be... how to render a full HTML request into the browser.

P.S. I notice Blazer is so new that it's not even a tag on StackOverflow!

Etienne Charland
  • 3,424
  • 5
  • 28
  • 58

1 Answers1

0

Use MarkupString

Example

<button>@((MarkupString)BtnLoginText)</button>

@code{
    private string BtnLoginText = "<i class='fas fa-sign-in-alt'></i> Sign IN";

}
Zanyar Jalal
  • 1,407
  • 12
  • 29
  • I guess I can render a form within the page, and then invoke it to be posted via javascript. Might run into unexpected problems though. Or, write a proper PayPal implementation via its API. I think I'll go straight to the later, although it will be more work. – Etienne Charland Jun 21 '20 at 06:01