stevebot
stevebot

Reputation: 24035

ASP.NET equivalent of JSP include

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?

Upvotes: 2

Views: 1527

Answers (2)

शेखर
शेखर

Reputation: 17604

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.

Upvotes: 3

Nathan
Nathan

Reputation: 1016

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.

Upvotes: 2

Related Questions