2

In JSP I can share HTML code by using include:

<jsp:include page="subsection.jsp" >

For the life of me, I can't tell how in ASP.NET I should be including shared HTML. I could use a template control, but this really isn't the same thing. I could use a site master page and content placeholders, but this also is not the same and requires a different approach to developing my pages.

Am I out of luck or is there a function in ASP.NET similar to JSP's include?

stevebot
  • 23,275
  • 29
  • 119
  • 181

2 Answers2

3

You will have to enable it from the server then only you can use include html files.

<!-- #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.

शेखर
  • 17,412
  • 13
  • 61
  • 117
  • thanks, this is the closest command I have seen to JSP include, even though it is happening in IIS. – stevebot Apr 18 '13 at 16:23
2

I think what you are wanting can be accomplished in Asp.Net through User Controls. If you were in Asp.Net MVC you would want to use Partial Views.

Nathan
  • 1,016
  • 7
  • 16