I have this <div class='divname'>...</div>
where I use this in many other pages.
Instead of repeating this code can we create a html
file and include it in aspx
page? if yes how?
I am not using Masterpage, and my backend is vb.net
Simple Markup in the Header Embedding an HTML file is simple. All we need to do is use the common „<link>“ element. Then we add the value „import“ to the „rel“ attribute. Using „href“ we attach the URL of the HTML file, just like we are used to when it comes to stylesheets and scripts.
What is an ASPX file? A file with . aspx extension is a webpage generated using Microsoft ASP.NET framework running on web servers. ASPX stands for Active Server Pages Extended and these pages are displayed in web browser at user end when the URL is accessed.
An alternative to include plain html in your .aspx files is to use old asp include directive, like this:
<!-- #include file="~/path/to/your-static-file.html" -->
This way you don't need to create .net controls or masterpage as you said, just include the file you already have.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With