How I can include an external html file
in asp.net
web page. In PHP we can use include
function, if asp.net have any similar function, please let me know. My intention is, i have a common header html file, so I need to include that file in all aspx
pages.
Server side includes are available across different platforms and a useful for including static content. You can use them in IIS but I they need to be enabled in IIS7.
<!-- #include file="Static/Menu.html" -->
Instructions to enable SSI in IIS7 are available at http://tech.mikeal.com/
For dynamic content, there is a built-in method of templating called MasterPages, this should be used instead.
I'm presuming this is web forms?
The most typical way to do this in asp.net would be to use a Master Page. Include your header in the master page and have the content page inherit from this.
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