abc
abc
CC#
Created by abc on 11/14/2023 in #help
Blazor JS Interop - Bootstrap 5 Tooltip
Hey. I want to use the Bootstrap 5 Tooltip on divs. i have a site.js that has this func
function tooltip(id) {
var element = document.getElementById(id);
var tooltip = new bootstrap.Tooltip(element, {});
}
function tooltip(id) {
var element = document.getElementById(id);
var tooltip = new bootstrap.Tooltip(element, {});
}
my blazor looks like this
<div id="submit" data-bs-toggle="tooltip" data-bs-title="Submit your data!">
<MyPrimaryButton OnClick="Submit">@Localizer["Submit"]</MyPrimaryButton>
</div>
<div id="submit" data-bs-toggle="tooltip" data-bs-title="Submit your data!">
<MyPrimaryButton OnClick="Submit">@Localizer["Submit"]</MyPrimaryButton>
</div>
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if(firstRender)
{
await JSRuntime!.InvokeVoidAsync("tooltip", "submit");
}
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if(firstRender)
{
await JSRuntime!.InvokeVoidAsync("tooltip", "submit");
}
}
if i put alerts in the JS, those get triggered. but the tooltip doesnt render. any ideas?
12 replies
CC#
Created by abc on 7/9/2023 in #help
❔ C# Library - Word to PDF?
Hey. I have a project that can export data as word using SharpDocX library. Bottom line is somewhere in my code i reach a point where I have a byte array that can be deserialized to a docx document. Do you know of a library that can transform the docx to a pdf?
8 replies
CC#
Created by abc on 5/5/2023 in #help
❔ CORS error
I have enabled cors according to: https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-7.0 named policy and middleware policy.WithOrigins("http://localhost:7022").AllowAnyHeader().AllowAnyMethod(); i still get rom origin 'https://localhost:7022' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
5 replies