This tutorial describes how to use Classic ASP page layout include files in your ASP.NET pages. Full source code provided.
Tutorial Details:
ASP.NET .NET "Includelets" in ASP.NET Tutorial
A common way to build the navigation and layout for an ASP-driven website is to use include files. Most advanced ASP developers know that when you do this, it is best to encapsulate the functionality of the include file in a Sub or Function, and then to call this routine from the page that is including the file. This avoids problems with variable scope, allows parameters to be passed easily to the include file, and makes the code easier to read.
As these sites are migrated to use ASP.NET, it is likely that classic ASP and ASP.NET pages will exist side-by-side, which is one of the touted advantages of ASP.NET. Unfortunately, there is no built-in way for an ASP.NET page to take advantage of a classic ASP include file, which means that the obvious solution if you want to maintain a consistent look and feel is to duplicate the look of the classic ASP template in an ASP.NET user control.
To overcome this problem, I built a simple user control that uses ASP.NET's built-in page-scraping library, HTTPWebResponse, to grab a template ASP file and render it in my .aspx page. The template ASP file is simply a page that includes my presentation logic include file, and calls the functions to render the HTML, passing through any querystring parameters it has to those functions.
The include file is equally simple-a single method that outputs some HTML. Note that this file can be called by either VBScript or JScript ASP pages, and avoids any context switching. It could also be called several times on one page, This is really pretty straightforward. In the page_load of the control, we grab use the HTTPWebResponse object to scrape the contents of header_template.asp, passing it our public property, page_title .
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: ASP.NET .NET "Includelets" in ASP.NET Tutorial
View Tutorial: ASP.NET .NET "Includelets" in ASP.NET Tutorial
Related
Tutorials:
JavaWorld - Net News
Central
JavaWorld - Net News
Central |
Integrate Java and C++ with Jace
Integrate Java and C++ with Jace |
Rumble in the
jungle: J2EE versus .Net, Part
1
Rumble in the
jungle: J2EE versus .Net, Part
1 |
A first look at JavaServer Faces, Part I
A first look at JavaServer Faces, Part Learn how to implement Web-based user interfaces with JSF |
J2EE 1.4 eases Web service development
J2EE 1.4 eases Web service development |
Excellent
tutorial on Struts and Tiles
Excellent tutorial on Struts and Tiles
This tutorial assumes knowledge of Java, JDBC, Servlets, J2EE (with regards to Web applications) and JSP Struts in a holistic manner, minus the beads and crystals.
The Tiles framework makes creating reusable pages |
Java and .Net interoperability using CORBA
Java and .Net interoperability using CORBA
A recently released product takes the pain out of implementing object-level calls between Java and .Net
While the need for interoperability between Java and .Net has become a common problem in larger organ |
Light-Weight Visual Components Library for different platform: SWT, J2SE, J2ME, .NET
Light-Weight Visual Components Library for different platform: SWT, J2SE, J2ME, .NET |
The JDBC RowSet Implementations Tutorial
In "The JDBC RowSet Implementations Tutorial," you will look at how to use the standard JDBC RowSet implementations specified in JSR-114. |
Jeff Schmitt's JDBC Page
This tutorial assumes you are using the MySQL database and the GWE JDBC drivers. The host computer is triton.towson.edu. |
Servlet Essentials
This document explains the concepts of Java Servlets and provides a step-by-step tutorial for writing HTTP Servlets with complete source code for the example Servlets. The tutorial and the other chapters cover all facets of Servlet programming from a ... |
JSP Tutorial
This Tutorial is for beginners in the Java Server Pages Technology |
JavaServer Pages Technology - Documentation
Sun's tutorial for Java Server Pages that provide a good introduction to design web pages with JSP. |
Tag Libraries Tutorial
This tutorial describes how to use and develop JavaServer Pages tag libraries. The tutorial assumes that you know how to develop servlets and JSP pages and are familiar with packaging servlets and JSP pages into Web application archives. |
Device Driver Tutorial for the Solaris OS
Make your hardware work with the Solaris OS on x86 or SPARC architectures. If you are a beginning Solaris kernel programmer, start with this new tutorial on docs.sun.com. |
JavaRSS.com 2004: Review of the Year
A look back at the major events of 2004 in Java. |
Interoperability with Patterns and Strategies for Document-Based Web Services
In Part 2 of this article, we demonstrate interoperability for document-driven web services with Microsoft .NET (C#) using strategies discussed in Part 1. |
Open Source Web Frameworks in Java
Open Source Web Frameworks in Java
Open Source Web Frameworks in Java
Struts
Struts Frame work is the implementation of Model-View-Controller (MVC) design pattern for the JSP. Struts is maintained as a part of Apache Jakarta project and is open |
Welcome to the Jboss 3.0 Tutorial
Welcome to the Jboss 3.0 Tutorial
Welcome to the Jboss 3.0 Tutorial
10 Minutes Guide to Ant
Comprehensive description of Ant with example.
Building Web Application With Ant and Deploying on Jboss 3.0
This lesson shows you how to build you web |
What is WAP? Detailed discussion of WAP API with examples.
What is WAP? Detailed discussion of WAP API with examples.
Learn WAP in 60 minutes
W ireless Application Protocol or WAP for short, allows the developers to develop next generation web application for cellular devices. Through WAP enabled mobile |
|
|
|