Thursday, October 07, 2004

Cool New/Old Trick

I am rewriting part of an application in ASP.NET however, it is still going to need to be in a directory that is mostly classic ASP. In my classic ASP pages, I have <!--#include virtual="mynav.htinc"-->. Well if I were writing the ASP.NET application from sratch I would put the navigation in a .ascx file. However, being that this is a joint resident application, I don't want to do that, because that would mean I have two files to update instead of just the one. (being a lazy programmer, I don't want to have to update an additional file). So how do I use the old .htinc file in my new ASP.NET application. The answer my friends is response.writefile. In your aspx page you simply write the file in. It will read the file, and write the content to the page as it is rendered, just like the virutal include would.




No comments: