All Answers

0 votes

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

0 votes

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

0 votes

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

0 votes

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>

0 votes

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.

0 votes
In reply to: Testing a session ID

To fix the compiler error, you have to add a reference to System.Runtime.Caching assembly in the project.

  1. Right-click your project → Add → Reference…
  2. Go to Assemblies → search for System.Runtime.Caching
  3. Check it → OK

OR simply add this code to your .csproj file:

<ItemGroup>
<Reference Include="System.Runtime.Caching" />
</ItemGroup>

0 votes
In reply to: Testing a session ID

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

 

0 votes
In reply to: Canvas Drawimage

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
}

0 votes

Figured it out by myself now; under properties, add a “font” entry and set to e.g. defaultBold.

0 votes

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

0 votes
In reply to: Error setting color

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

 

0 votes

Thanks Gabriele,
I solved it.
Comparing the IIS configurations on the two servers, I noticed that the WebSocket protocol was disabled on the 2025.

0 votes

I have tried to reproduce the problem on a fresh installed Windows 2025 server but all works as expected.

0 votes

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

0 votes
In reply to: Concat PDF

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

0 votes

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).

  1. I used Button1 to draw a rectangle which fires the method “Test”.  It didn’t draw and the error: Unknown function: drawFurnishingsMovement showed, but with a second click and any subsequent clicks it worked fine.  Not sure what’s happening there.  I thought I had initialization covered.
  2. I added some mouse handlers.  They don’t seem to be working.  I created a test “TestWidgetSetup” method to use with the button for this and it failed as well.

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

0 votes

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

0 votes
In reply to: Wisej.AI Trial Version

No, you need to become a Technology Partner for access to Wisej AI. You can contact sales AT wisej.com for more information.

0 votes
In reply to: Testing a session ID
0 votes

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

Showing 41 - 60 of 11k results