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.
Thanks a lot – we’ll try out your proposals ASAP.
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:
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:
Hope this helps,
Julie
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
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”);
thx dear
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.
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.
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.
Hi Frank, here’s the video you requested…
Regards
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
Hi Angelo,
what is the performance when you run your project inside Visual Studio in Release Mode?
Best regards
Frank
Can you be more specific- what are you struggling with and what questions do you have that could be addressed by additional documentation?
Julie
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
Hi Angelo,
what does “open the form” actually mean? Open in the designer or running in debug mode inside Visual Studio?
Best regards
Frank
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
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
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;
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
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
