Hi,
I have a string html that contains a large html including CSS for a sticky menu and a “back to top” button”.
If I want to display it in a different page, it works perfectly with code:
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(htmlContent);
using (MemoryStream ms = new MemoryStream(bytes))
{
Application.DownloadAndOpen(“_blank”, ms, $”catalog_{dataValabilitate}.html”);
}
But now I want to display it and replace my application page. I tried with
var p1 = new Page();
var h = new HtmlPanel();
h.Html = html;
h.Dock = DockStyle.Fill;
p1.Controls.Add(h);
p1.Show();
It is displayed, but all button/menu functions are inactive.
In css I have something like
.back-top {
position: fixed;
bottom: 20px;
left: 25px;
background: #3498db;
color: white;
padding: 10px 20px;
border-radius: 50%;
font-size: 18px;
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.back-top:hover {
background: #2c3e50;
}
….
and in html <a href=’#top’ class=’back-top’>↑</a>
Any way to activate CSS actions? Or to display my html instead of application page?
