Hi Rene,
my initial answer was wrong or not entirely correct.
Some shortcuts can be overridden with Accelerators.
Please find attached a sample for CTRL+S that seems to be working in Chrome, Firefox, IE and Edge.
But you might test around a bit to see if your shortcut works in your target browsers.
Best regards
Frank
Hi Justice,
we can’t work on this spare information. Please provide more details about your application and setup.
Is it failing inside Visual Studio? On a deployed version (IIS?)? Windows? Linux? etc.
If it’s on a deployed server you might find this useful:
https://docs.wisej.com/deployment
Best regards
Frank
Hi Rene,
short answer: You can’t. It’s up to the browser to handle these shortcuts before they even reach the web application.
So only way is to search for browser setup options.
Best regards
Frank
Make sure that you have included the Wisej2 (or Wisej3) nuget package in your project. Check your .csproj file, there should be a line that looks something like this:
<ItemGroup>
<PackageReference Include="Wisej-3" Version="3.5.*" />
<PackageReference Include="System.Data.SqlClient" Version="4.*" />
</ItemGroup>
You can do this by using accelerators and the ClientClipboard extension.
Make sure to install the ClientClipboard extension using nuget.
To create an accelerator, open the Page in the designer and go the the Page properties. Click on the 3 dots by “Accelerators” and click “Add”. Click on the dropdown arrow and click the box for ctrl and set the key to C. See attached picture.
Once that’s set up, go to the lightning bolt to open the events for the page. Add an “Accelerator” event. It should be called Accelerator_CtrlC
Then paste this code in the accelerator event:
private async void Accelerator_CtrlC(object sender, AcceleratorEventArgs e)
{
if (dataGridView1.CurrentCell != null)
{
var value = dataGridView1.CurrentCell.Value?.ToString();
await ClientClipboard.WriteTextAsync(value);
}
}
I’ve attached a working sample here.
To fix the compiler error, you have to add a reference to System.Runtime.Caching
assembly in the project.
OR simply add this code to your .csproj file:
<ItemGroup>
<Reference Include="System.Runtime.Caching" />
</ItemGroup>
Hello Julie,
Thanks for your quick answer. When I try to code something like if (System.Runtime.Caching.MemoryCache.Default.Get(mySessionId)==null) the compiler says that Caching doesn’t exist in System.Runtime. The funny thing is that if I test this in the quickWhatch at runtime it words indeed.
The application I’m working with creates some directories on the disc with the sessionId as name for working purposes. I now would like to destroy those directories if the session ID is no longer valid. How can I distiguish invaid ones from the ones still in use ?
TIA
Mirko
You need to put your code in the redraw event of the canvas.
When you call the drawing actions on a canvas control they are executed on the browser but not persisted. In Redraw you have to update the control and draw what is persisted.
Your code should look like this:
private void canvas1_Redraw(object sender, EventArgs e)
{
MakeBoard((Canvas)sender);
//insert code here that draws the png images
}
Figured it out by myself now; under properties, add a “font” entry and set to e.g. defaultBold.
Hi Luca,
You can use the AddHttpClient() extension method to add the HttpClient to your service container, but in order to use it you’ll need to use Microsoft’s IServiceProvider.
The code in startup.cs should look like this:
// ASP.NET Core startup
public class Startup {
public static void Main(string[] args) {
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
{
Args = args,
WebRootPath = “./”
});
builder.Services.AddHttpClient();
var app = builder.Build();
// Register Microsoft’s IServiceProvider with Wisej.NET.
Application.Services.AddService<IServiceProvider>(app.Services);
app.UseWisej();
app.UseFileServer();
app.Run();
}
}
Then you can use it as you would normally would, i.e calling httpClientFactory.CreateClient();
HTH,
Alaa
Hi all,
We encountered the same issue after upgrading from version 3.5 to version 4.0.
Were you eventually able to find a workaround for the problem?
Kind regards,
Tom
Thanks Gabriele,
I solved it.
Comparing the IIS configurations on the two servers, I noticed that the WebSocket protocol was disabled on the 2025.
I have tried to reproduce the problem on a fresh installed Windows 2025 server but all works as expected.
Hello,
Unfortunately there’s no way to disable the Server Express popup. The only way would be to switch to a paid server license. You can find more details here: https://wisej.com/server-licenses/
-Julie
Hi Mirko,
Since Wisej.NET is part of the .NET ecosystem, you can try one like iTextSharp.
Concatenating a PDF or editing it is not part of Wisej.NET, unless you can find a viewer that offers such features.
Best Regards,
Alaa
Hi Julie,
You suggestion about the GetResourceString was very helpful. I’m still having problems with streamlining this application, I created a test project (attached).
In my real project, I simply want to drag some boxes across the widget that is superimposed on a picture box. The app uses GDI+ to draw the objects on the picture box but dragging them by redrawing via GDI+ is too slow. The idea is do a final redraw of the scene without the objects stored in the picture box, with the objects I want to move then drawn on the widget superimposed on the background scene in the picture box. I simply want to select an object and drag it to another position. Perhaps there’s an existing javascript out there that already can do this.
On a side note: In the test project I tried to use Application.MainPage.top and similar to position my pictureboxes added to simlate my real project. It showed Application.MainPage was nothing despite the call in Program.vb (Application.MainPage = new Page1()). This works in my real project upgraded from WiseJ 2.5 but not in the new WiseJ4 project. Just curious.
Thanks again,
Gerry
Hi Julie,
I added a class OverlayCanvasWidget as per your suggestion, which contains Return GetResourceString(“OverlayCanvasWidget.js”). “OverlayCanvasWidget.js” is set to Embedded Resource. I’m getting an error message on form load:
Error: “Unknown function: drawFurnishingsMovement”
I initialize the widget like this: Private WithEvents OverlayWidget As New OverlayCanvasWidget() and on load make a call to clear it:
OverlayWidget.Call(“drawFurnishingsMovement”, New Dictionary(Of String, Object) From {
{“dx”, 0},
{“dy”, 0},
{“objects”, New List(Of Object)()}
})
Do I need a line in Default.html like: <script src=”Scripts/Widgets/OverlayCanvasWidget.js”></script>? What else could I be missing?
Thanks very much for you help!!
Gerry
No, you need to become a Technology Partner for access to Wisej AI. You can contact sales AT wisej.com for more information.
System.Runtime.Caching.MemoryCache.Default.Get(id)
See attached test case.
You need to put all of the js code in a single file, in this case I put it in a file called startup.js.
If you want to load the js code from a file instead of setting it as a string in the InitScript, you need to create a new class that derives from Widget.
Public Class NewWidget
Inherits Wisej.Web.Widget
Public Overrides Property InitScript As String
Get
Return GetResourceString("WidgetTestApp.startup.js")
End Get
Set(value As String)
End Set
End Property
End Class
Note this line of code: Return GetResourceString("WidgetTestApp.startup.js")
is where you are telling it where to find the js code. In VB.NET you don’t need to include the folder name like you do in c#. See https://docs.wisej.com/docs/concepts/embedded-resources#resources-and-platform-folders