Posts

Showing posts with the label blazor

Blazor .NET Core: How can I set the connection string?

Image
Clash Royale CLAN TAG #URR8PPP Blazor .NET Core: How can I set the connection string? I am trying to use Blazor's CRUD functions and following some article to do this. In the article, there is a part that I should put my connection in context file, but it doesn't say how to set the connection string. I put this code line in launchSettings.json: { "ConnectionStrings": { "UserDatabase": "Server=DESKTOP-2K2A6GN;Database=Assignment4;Trusted_Connection=True;" }, "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:56244/", "sslPort": 0 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT...

Is there an equivalent to Html.Raw in Blazor?

Image
Clash Royale CLAN TAG #URR8PPP Is there an equivalent to Html.Raw in Blazor? I have some HTML that is stored in a string. How can I render this is a Blazor/Razor view without automatic HTML encoding? 2 Answers 2 Not right now, but will have it probably in the next version: Follow this Workaround (from that issue): cshtml index.html Feature to render raw HTML was added in Blazor 0.5.0 version. This is the example of how raw HTML can be rendered from string containing HTML content: Blazor string @((MarkupString)myMarkup) @functions { string myMarkup = "<p class='markup'>This is a <em>markup string</em>.</p>"; } More info can be found in "Blazor 0.5.0 experimental release now available" announcement. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of servi...