0

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!

Community
  • 1
  • 1
Interstellar
  • 562
  • 2
  • 9
  • 28
  • You probably want to be using User Controls for this functionality - http://stackoverflow.com/questions/5217601/when-do-you-need-ascx-files-and-how-would-you-use-them – Richard Dalton Jun 03 '14 at 12:30

1 Answers1

1

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
Community
  • 1
  • 1
शेखर
  • 16,910
  • 12
  • 52
  • 105