skyslide22
skyslide22
CC#
Created by skyslide22 on 3/14/2024 in #help
✅ anyone problems with c# devkit?
No description
5 replies
CC#
Created by skyslide22 on 12/11/2023 in #help
Net8 Blazor onclick="js()" Not Working
i have a button with enhance navigation set to false but the blazor.web.js still fires and replaces my dom manipulations with the result from the server the onclick is not working, blazot replaces the element instantly after js manipulation i can see that in the network tab in the chrome dev tools how can i disable that stuff?
<a href="#ateam" data-enhance-nav="false" class="btn read-more-cta" onclick="this.style.display='none';">
Read more
@* <i class="fa fa-arrow-down"></i> *@
<i class="fa-regular fa-chevrons-down"></i>
</a>
<a href="#ateam" data-enhance-nav="false" class="btn read-more-cta" onclick="this.style.display='none';">
Read more
@* <i class="fa fa-arrow-down"></i> *@
<i class="fa-regular fa-chevrons-down"></i>
</a>
5 replies
CC#
Created by skyslide22 on 12/7/2023 in #help
Maui + WebView - FULL Transparent App - Is It Possible?
Is there a way to have a full maui app with a transparent window + transparent webview & no title bar? (macos only for now)
7 replies
CC#
Created by skyslide22 on 10/25/2023 in #help
✅ How to register a onNavigate/navigation event callback in Net8 SSR?
blazor.web.js replaced the entire html on navigate with the response, but scripts like <script src="js/myscript.js></script> are NOT executed again. so if any js is used it will break on any navigation change. how can i register a callback for a navigation change? i have seen there is Window.Blazor.addEventListener() but there is absolute no documentation
2 replies
CC#
Created by skyslide22 on 8/10/2023 in #help
✅ .csproj – how to generate nodes dynamically by iterating over a string array ?
how can i generate xml code in the .csproj file? i dont want to repeat my actions 10000 times... so i got a list of strings i want to insert in some xml nodes:
my-items =
Utils\**\*.*;
Settings\**\*.*;
Extensions\**\*.*;
Components\**\*;
Templates\**\*;

foreach item in my-items
do
<ItemGroup>
<None Include="@item">
<Link>@item\%(RecursiveDir)/%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
end
my-items =
Utils\**\*.*;
Settings\**\*.*;
Extensions\**\*.*;
Components\**\*;
Templates\**\*;

foreach item in my-items
do
<ItemGroup>
<None Include="@item">
<Link>@item\%(RecursiveDir)/%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
end
4 replies
CC#
Created by skyslide22 on 7/21/2023 in #help
✅ How to get build date of a asp.net app?
i want to display the YYYYMMDD in a blazor wasm app, how can i get the build date to display? i have tried this
<PropertyGroup>
<PreBuildEvent>date +"%Y %m %d" > "$(ProjectDir)wwwroot\BuildDate.txt"</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>date +"%Y %m %d" > "$(ProjectDir)wwwroot\BuildDate.txt"</PreBuildEvent>
</PropertyGroup>
but that creates a file "\wwwroot\BuildDate.txt", not a file IN wwwroot... ????
6 replies
CC#
Created by skyslide22 on 6/14/2023 in #help
❔ Python Decorators in C# ??? How do i intercept method calls with attributes?
Is is possible to intercept/prevent a method call in c# with attributes? i was thinking about something like python decorators, which can decide what happens with the method call, args and return value
[ThrowIfIdMatches("id", 69)]
public string MyMethod(int id)
{
return "my id is " + id
}
[ThrowIfIdMatches("id", 69)]
public string MyMethod(int id)
{
return "my id is " + id
}
that should throw a ValueError if the id parameter is 69, for example
63 replies
CC#
Created by skyslide22 on 5/4/2023 in #help
✅ SignalR Blazor Wasm Not Reliable When Deployed
ay, i got a blazorwasm --hosted project, where we have build a chat app. the problem is, when deployed to azure, the chat is not working all the time, the messages are missing, randomly. also, we use a controller to inject messages, that one is also not working sometimes this is the controller we use
[ApiController]
[Route("[controller]/[action]")]
public class ApiController : TwilioController
{
private readonly IHubContext<ChatHub> _hubContext;

public ApiController(IHubContext<ChatHub> hubContext)
{
_hubContext = hubContext;
}


[HttpPost]
public async Task<bool> InsertSMSIntoChat(InsertSMSIntoChat_InputParams iparams)
{
try
{
await _hubContext.Clients.All.SendAsync(Messages.RECEIVE, iparams.PhoneNumber, iparams.Message);
Console.WriteLine("user "+ iparams.PhoneNumber + " wrote " + iparams.Message + " (API)");
return true;
}
catch(Exception e)
{
return false;

}

}
}
[ApiController]
[Route("[controller]/[action]")]
public class ApiController : TwilioController
{
private readonly IHubContext<ChatHub> _hubContext;

public ApiController(IHubContext<ChatHub> hubContext)
{
_hubContext = hubContext;
}


[HttpPost]
public async Task<bool> InsertSMSIntoChat(InsertSMSIntoChat_InputParams iparams)
{
try
{
await _hubContext.Clients.All.SendAsync(Messages.RECEIVE, iparams.PhoneNumber, iparams.Message);
Console.WriteLine("user "+ iparams.PhoneNumber + " wrote " + iparams.Message + " (API)");
return true;
}
catch(Exception e)
{
return false;

}

}
}
11 replies
CC#
Created by skyslide22 on 3/31/2023 in #help
❔ Code (.razor) formatter for vscode?
is there a code formatter out there which supports razor files? prettier doesn't seem to support this language, the built-in c# formatter does nothing
2 replies
CC#
Created by skyslide22 on 3/30/2023 in #help
✅ Is there a working code editor for blazor server?
i found one for blazor wasm https://github.com/serdarciplak/BlazorMonaco but that one does not work with blazor server are there any alternatives for code highlighting in blazor server (razor files)?
6 replies
CC#
Created by skyslide22 on 1/22/2023 in #help
❔ Blazor Server access DOM via querySelector and keep the references
ay, how can i get references for @onclick(c# func)? i got a big svg with 200 elements and i want to query them all and add a onclick method to them. i guess i need to call the c# func from js don't i?
2 replies