ASPX templates
Version 4.x > ASPX templates > Include File or Response.WriteFile View modes: 
User avatar
Member
Member
jslist-sbcglobal - 7/21/2013 5:51:15 PM
   
Include File or Response.WriteFile
Can you send over an example of using an Include File or Response.WriteFile .. Have a utility that creates a nice picture show and gives me an .html file. I'd like to show that inside a page.

I created an aspx page and used a pageplaceholder - Don't know if that's the correct thing or not.

User avatar
Kentico Support
Kentico Support
kentico_filipl - 7/21/2013 10:40:17 PM
   
RE:Include File or Response.WriteFile
Hello,

Pageplaceholder only defines where the content and web part zones could be placed inside a template. If you want to use Response.WriteFile() method, you can do it in the source code of the template (~\CMSTemplates project folder) or a certain web part (~\CMSWebParts folder) and when it is used on an actual page, this method is executed as well.

Best regards,
Filip Ligac

User avatar
Member
Member
positivepurchasing - 9/26/2013 6:39:20 AM
   
RE:Include File or Response.WriteFile
Hi,

Within Kentico v7 i have been using an include file for a asp page and would like to use Response.WriteFile() instead as this page may at some point have dynamic content.

Presently;
<!--#include file="~/App_Themes/cheese.asp" --> (works)

Would like to use;
Response.WriteFile ("~/App_Themes/cheese.asp") (fails)

I am changing this in the template but all I am getting is the text 'Response.WriteFile ("~/App_Themes/cheese.asp")' displayed in the page rather than the html contained within the asp file?

What am i doing wrong?

User avatar
Member
Member
positivepurchasing - 9/26/2013 8:22:26 AM
   
RE:Include File or Response.WriteFile
The correct code is;

<% Response.WriteFile ("~/App_Themes/cheese.asp"); %>