All Answers

0 votes

Using Application.Navigate to access the html file is pretty simple.

Simply add the html file to your project, ie myhtml.html.

Then access it with Application.Navigate.

Application.Navigate(“myhtml.html")

See attached test case.

 

0 votes

Thanks a lot – we’ll try out your proposals ASAP.

0 votes

The Application.ClientId is stored in the browser’s LocalStorage. The reason you’re seeing ClientId changing after closing and reopening the browser is most likely due to recent browser privacy changes.
Modern browsers (Chrome, Edge, Firefox) have been implementing stricter privacy measures, including:

  • Storage partitioning – Browsers are now partitioning localStorage by top-level site to prevent cross-site tracking
  • Third-party cookie blocking – Browsers are increasingly blocking or limiting third-party cookies and storage access

Solutions
1. Use Cookie-Based Storage Instead
You can store your own client identifier in cookies rather than relying solely on Application.ClientId:

// At application start, check for existing client ID in cookies
var existingClientId = Application.Cookies["MyClientId"];
if (string.IsNullOrEmpty(existingClientId))
{
// Generate and store a new client ID
var newClientId = Guid.NewGuid().ToString();
Application.Cookies.Add("MyClientId", newClientId);
}

2. Configure Session Storage to Use LocalStorage
In your Default.json, ensure you have the session storage set to “local”:

{
"sessionStorage": "local"
}

This allows the session to survive browser closure, but may still be affected by browser privacy settings. See https://docs.wisej.com/docs/concepts/configuration for more information

3. Implement User Authentication
The most reliable approach is to implement proper user authentication. When users log in, you can associate their session with their user account in your database, making browser storage irrelevant for session recovery:

// After successful login
Application.Session.UserId = authenticatedUserId;
// Store session info server-side linked to the user

4. Check Browser Settings with Users
Have affected users check their browser settings for:

  • “Clear cookies and site data when you close all windows” (in Chrome: Settings → Privacy and Security)
  • Any browser extensions that clear storage data

 

Hope this helps,

Julie

0 votes

Can you please attach a test case that reproduces the issue? Delete the bin and obj folders before posting to make the file size smaller.
Thanks,
Julie

0 votes

You can do the first approach like this:
string myHtml = "<html><head><style>body{background:blue;}</style></head><body><h1>Hello</h1></body></html>";
string base64Html = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(myHtml));
webBrowser1.Url = new Uri($"data:text/html;base64,{base64Html}");

For the second approach, you can create an endpoint/handler that returns your HTML and navigate to it:
Application.Navigate(“/api/catalog?id=123”);

0 votes

thx dear

0 votes

It drops down automatically. You are trying to change the default behavior and breaking it. Post a working small test case that opens in VS and runs. This way it’s easier to fix your code. It’s too much time to copy your snippet in a working project.

  • JD answered Dec 10, 2025 - 11:41 am
0 votes

Hi Julie,

What I need is that: when specific conditions are met (in parameters, etc; doesn’t concern the topic), I need one of the 2 posibilities:

1. Display the full html (with css, etc) in a webbrowser control. But I wasn’t able to find HOW to execute something like
WebBrowser wb;
wb.html=myHtml; //that doesn’t exist; what can I do?

2. Completely replace my application with myHtml. I tried:
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(html);
using (MemoryStream ms = new MemoryStream(bytes))
{
Application.DownloadAndOpen(“_blank”, ms, $”catalog.html”);
}
Application.Navigate(“javascript:window.close();”);

That works, but the browser display a warning “allow pop-up” or “pop-up blocked” that prevent the opening of the new tab.

The first approach will be better, if you can tell me how to “inject” all html in WebBrowser.

0 votes

The HtmlPanel control in Wisej.NET is designed to display HTML content, but it doesn’t create a full browser environment. Instead, it renders HTML within Wisej’s own widget framework. Because of this, CSS pseudo-classes like :hover still work correctly, since they are handled by the browser. However, anchor links such as <a href=’#top’> do not behave as they normally would, because HtmlPanel does not create a standard browsing context with typical navigation. In addition, any JavaScript included in your HTML will not be executed.

If you want to display the HTML within your application while keeping the app active, use IFramePanel or WebBrowser control. These create a real iframe/browser context where CSS and anchor links work properly.

0 votes

Hi Frank, here’s the video you requested…
Regards

0 votes
In reply to: IISEXPRESS SLOW

Hi Frank,

In Release Mode I have the same performance.

I notice that the problem is when then form create the columns on the grid for the first time.

In fact, if instead of closing the form, I execute the ‘Hide’ method and subsequently ‘Show’ the problem does not occur.

 

Best regards
Angelo

0 votes
In reply to: IISEXPRESS SLOW

Hi Angelo,

what is the performance when you run your project inside Visual Studio in Release Mode?

Best regards
Frank

0 votes

Can you be more specific- what are you struggling with and what questions do you have that could be addressed by additional documentation?

Julie

0 votes
In reply to: IISEXPRESS SLOW

Hi Frank,
When Running in debug mode inside Visual Studio.
If it helps, I’ll briefly describe what the software does when the form opens.
– The form contains a custom datagridview.
– The form’s MyBase.Load event calls the ‘DGV_M_SetColumns‘ method which adds the columns to the grid:

Typical code for adding a column

txtC = New ASNetL.Wsj3.Forms.wDataGridViewTextBoxColumn
FieldName = “prfvcl_targa”
With txtC
.Name = FieldName
.DataPropertyName = FieldName
.HeaderText = “PLATE”
.Width = 150
.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft
.DefaultCellStyle.Format = “”
.ToolTipText = “Vehicle License Plate”
.Visible = True
.FilterEnable = True
.EditModeOnGrid = ASNetL.Wsj.wEnum.EditModeOnGridEnum.NoEditable
‘I add the column to the grid
DGV_M_GRD.Columns.Add(txtC)
End With

– The MyBase.Shown event of the form calls the ‘FILL‘ method which essentially performs the binding of the grid:

PgSQL_Conn = New NpgsqlConnection(ConnStr)
PgSQL_Conn.Open()
DgvData.Clear()
PgSQL_Command.Connection = PgSQL_Conn
PgSQL_Command.CommandText = qry + WhereFlt
PgSQL_Adapter.SelectCommand = PgSQL_Command
PgSQL_Adapter.Fill(DgvData)

dgvBindingSource.DataSource = DgvView
dgv.AutoGenerateColumns = False
dgv.DataSource = dgvBindingSource

In summary, I noticed that the ‘DGV_M_SetColumns’ method slows down the form display (up to 10 seconds). In fact, if it’s commented out (and I don’t call it), the form displays quickly. However, this only happens when running with Visual Studio (IISExpress). If the application is deployed on a server (IIS), everything works without any delays.

Tanks

 

0 votes
In reply to: IISEXPRESS SLOW

Hi Angelo,

what does “open the form” actually mean? Open in the designer or running in debug mode inside Visual Studio?

Best regards
Frank

0 votes

Hi Rusty,

You would need to do the following if you’re aiming to publish using the publishing tools:

Replace <TargetFrameworks> with <TargetFramework> in your csproj file

When the publishing has succeeded, go to your web.config file and make sure that the AspNetCore is the first handler that appears before Wisej’s (it’s easily identifiable by the .wx extension)

And you should be good to go!

Please note that the publishing tool only works with .NET CORE targets (i.e .NET 8.0 and up)

If you want to target .NET Framework 4.8, then please follow the guide here: https://docs.wisej.com/deployment/targets/iis#net-framework

HTH,
Alaa

  • Alaa (ITG) answered Nov 28, 2025 - 9:51 am
  • last active Dec 2, 2025 - 8:29 pm
0 votes

Hello,
Here are some potential solutions:

1. Clear Visual Studio Designer Cache
Sometimes, layout scaling metadata persists.
Close Visual Studio.
Delete all .vs, bin, and obj folders in your solution directory. (I know you already mentioned the bin and obj folders, try deleting the .vs folder as well)
Reopen Visual Studio and rebuild your project.

2. Verify Project DPI Settings

In some cases, the Wisej project file (.csproj) may contain incorrect manifest or scaling settings.
Check your .csproj for: EnableWindowsFormsHighDpiAutoResizing

Wisej uses its own DPI management, so ensure this property is set to false or removed.

3. Windows Display Settings

If you are using two monitors. Ensure both monitors use the same scaling factor (100% or 125%).
Mixed DPI environments can desync the designer render area.

4. Open the Designer.cs file.

Manually set Location = new Point(0, 0) for the main container or top-level panels.

5. Try resetting Visual Studio settings
Open Visual Studio.
Navigate to Tools > Import and Export Settings.
Select “Reset all settings”: in the Import and Export Settings wizard.

 

Hope this helps,

Julie

1 vote
In reply to: datagridview / search

This might a little late for an answer, but I use to search through the DataTable that feeds the grid instead of a direct search within the grid.


string searchText = txtSearch.Text.Trim();
if (searchText != "" && _data != null && _data.Rows.Count > 0)
{
      DataRow[] searchData = _data.Rows.Cast()
.Where(r => r.ItemArray.Any(
c => c.ToString().IndexOf(searchText, StringComparison.OrdinalIgnoreCase) > 0
)).ToArray();
      grdReceivingLogs.DataSource = searchData.CopyToDataTable();
}
else
      grdReceivingLogs.DataSource = _data;

  • Maestro answered Nov 28, 2025 - 11:21 pm
0 votes

Hi Reza,

While we strive to add newer features to Wisej.NET on a regular basis, the RTL enhancements are going to need more time to be implemented!

Make sure to follow our newsletter and blog regularly to stay up to date.

Best,
Alaa

0 votes

Hello Everyone,

We have added a new wizard for adding controls when the ToolBox inevitably fails to bring up the ToolBox items.

With the release of Visual Studio 2026, it appears that this issue is fixed; but for those who are still experiencing it:

1- When in the designer, do a right click on any surface, and choose the “Add a new control” option (attached image 1)

2- A wizard should come up (attached image 2) , select your desired control to add it to the form/page/user control

And you’re good to go!

Best,
Alaa

Showing 21 - 40 of 11k results