Interstellar
Interstellar

Reputation: 674

#include in ASP.NET

Can we have #include in ASP.NET aspx source code so that part of the HTML code can be moved to different .aspx page & called when necessary in the Parent.aspx page. I gone through the URL http://en.cppreference.com/w/cpp/preprocessor/include but when I tried with #include Visual Studio 2012, intellisense didn't recogninzed it. So I'm not sure whether it is possible. Please guide.

Edit: I found another post Include another HTML file in a HTML file regarding #include. Here they have mentioned about HTML. Can we follow same with ASP.NET?

I apologize if you feel this is a basic or lame question!

Upvotes: 0

Views: 374

Answers (1)

शेखर
शेखर

Reputation: 17614

If you want to include html files like below

<!-- #include file = "..\myfile.htm" -->

Then you need to enable it in IIS.

Here is a link for the same

Some other links which may help you

  1. http://tech.mikeal.com/blog1.php/server-side-includes-for-html-in-iis7
  2. Enabling SSI on IIS

Upvotes: 1

Related Questions