![]() | |
![]() | |
![]() |
Web Development Information |
|
![]() |
Server Side Includes (SSI) with ASP
Server Side Includes (SSI) with ASPPeople often have identical sections of code spread throughout many ASP pages, typically code at the top of the page (usually referred to as the header) and the lower part of the page (the footer). Similarly, you may have code that performs a certain set of instructions that you are repeating across multiple pages. Consider an example:- <% Ok, ok... it's simple, but imagine that you used this on multiple pages. What's wrong with this picture? Well... you don't have to think about that long before realising that if you ever wanted to change something about that piece of code, you'd have your work cut out. you would have to change every page... everyone has done this at some stage and luckily most usually take the steps to learn a way around this problem. If we could save our valuable chunk of code into a file and have that file accessed whenever we needed the code, then we no longer have a problem when it comes to changing things, as we simply update one file. Include files or Server Side Includes (SSI) as they are more commonly known are a powerful way to not only save time when it comes to maintaining and updating a site, but also increase efficiency and speed of that site too! Ok, lets see how we use an include file... to start with we need to use one of two methods. The first one allows for including files relatively. By that I mean relative to the directory the ASP file that is using the include file resides. The second method includes files virtually. Including files virtually means that the path is taken from the root directory. Consider that we are going to have a file (/main/somefile.asp) include another file (/includes/someinclude.asp). To demonstrate, relative inclusion, look at this:- <% And here, we give an example of the other method, virtual inclusion:- <% Note the slight difference between the two methods. With virtual inclusion, you can move the file that calls upon the include file anywhere without affecting the outcome, because the path is always relative to the root. The same cannot be said however for relative inclusion. If you move a file that is using relative inclusion to a different directory, you'll most likely find the relative path is no longer correct. From the examples above, you may also notice that both methods, when calling the include do so OUTSIDE of the ASP script block. This because #include declarations are not interpreted by ASP. Include files are included before a single line of ASP is processed which means the following WONT work:- %lt;% We were attempting to perform a dynamic include and I would be the first to admit that the above would be very useful indeed if in fact it were possible. I do intend to cover a few methods that work around this set back but I know you will now be itching to get started right away on using include files to even worry about this, so I will cover it in a future article. I hope that you have found the above informative and hope it inspires you all to write code that's more efficient and more easily maintained. Rob Collyer, experienced with 20 years programming knowledge and site administrator of www.webforumz.com - Copyright 2003-2004
MORE RESOURCES: The Rise of Sustainable Website Design in Los Angeles: A New Standard for Green Tech StreetInsider.com Top 15 Front-End Technologies in 2025 DesignRush Top 5 Uses of WebAssembly for Web Developers The New Stack Web Design and Development Muskegon Community College UA Little Rock Student Gains International Experience as Web Development Intern in Australia University of Arkansas at Little Rock Rediscover the Joy of Early Web Development With XSLT The New Stack What’s Unique About Being a Web Dev in Israel? The Times of Israel The Rise of Rust and WebAssembly in Web Development The New Stack Essential Web Developer Skills for 2025 Simplilearn Where to sell a website? SitePoint 2024: Rising Senior Uses Computer Science Coursework to Thrive in Web Development Role Muhlenberg College Northeastern grad goes from schooling to working full time at web development startup he created Northeastern University How Much does Website Development Cost in 2022? Appinventiv Best PHP Frameworks for Web Development in 2024 Simplilearn Register for AIM’s free web development course by Sept. 10 Silicon Prairie News Top 10 Front End Languages: A Beginner's Guide Simplilearn Is Web Development Approaching Its Peak as We Head Into 2025? IoT Business News Best web design software of 2024 TechRadar Top Web Design Trends for 2025 Designmodo 23 In-Demand Full Stack Developer Skills in 2025 Simplilearn Web Design Statistics By UI/UX, Market Size, Web Development, Industry and Demographics Coolest Gadgets Elon Musk's DOGE Website Database Vulnerability Let Anyone Make Entries Directly - CybersecurityNews Best web development tool of 2024 TechRadar New Web Development Tool Pulls Design Tokens From Figma The New Stack Web Development | Website Design for Yachting Companies Yachting Pages 38 Web Development Stats You Should Know in 2024 Influencer Marketing Hub Generative AI for Web Developers O'Reilly Media 11 Best Interactive Website Designs in 2025 DesignRush The Top AI Tools for Web Development hackernoon.com |
![]() |
![]() |
![]() |
RELATED ARTICLES
Sticking To Your Plan So you have a good idea for a business and decided that the Internet would be the perfect place to start it.WAIT. Web Analytics - Getting it Right Understanding and using web analytics.In recent years, website marketers were concerned with increasing 'hits' and the 'stickiness' of their sites. Why Do I Need A Web Site? Even though the Internet has been around for a long time and many people are "educated" about the Internet, most have little knowledge about what a web site is and what can it do for their business.A web site is anything and everything you want it to be. How to Make Your Own Website For Free If you like the Internet and surfing through the billions of web pages on it then you might be thinking that you also would like to have your very own web page. Well, fortunately you can create your own web page for free and have it online so the whole world can surf the web and see what your web page is all about. Website Content & Usability Writing for the web is totally different to writing for printed matter. We tend to scan content on the web hunting for the information we're after, as opposed to reading word-for-word. The Importance of Website Stats to You One of the best tools you have as a webmaster is your website statistics. The most popular site stats programs are Awstats, Webalizer, and Analog. Earn On Offshore Web Design and Development If you have some experience in web site design and want to make good money you can try acting as IT-outsourcing partner. Learn more what you should know and how to start. Do You Really Need A Website To Succeed Rosalind wants to share her inspirational poetry with a wider community. Alas, poor Rosalind lives in a remote town. Having a Domain Name And Web Site Gives Your Business The Key To The Door Just like all things in life, the ways to run a business are rapidly changing and evolving. The potential involved with having a domain name/web site is staggering to say the least. Ten Quick Tests To Check Your Website For Accessibility The Disability Discrimination Act says that websites must be made accessible to disabled people. So how can you check that your website is up to par? There are a number of basic tests you can make to address some of the main issues that provide a good start in increasing accessibility to your site visitors:1. 9 Simple Steps to Create a Background Tiled Image Branded with Your Name You have seen those web pages where they have the name of the Name Web repeated over over over in square tiles as the background. Now by following these 9 Simple steps you too can create a web page Branded with your Name, or Company Name. Building eCommerce Websites that Work - Part 3 An interesting eCommerce success factor that isn't precisely overlooked, but which is often thought about more in terms of being a way of feeding the search engine spiders has to do with providing content. In a very real sense the customer's job is to consume. Product Promoting: Getting The Response When you publish a content site there are times when affiliate products are not the only products you want to recommend.Situations when you'll find you'll want to promote a non-affiliate businesses' product(s). If You Build It, They Will Come? Building a new website can be a lengthy task. From scratch to the client's specification and then implement additional features and/or changes the client usually has. Web accessibility for screen magnifier users The needs of screen magnifier users are overlooked when implementing web accessibility on to a website. Screen magnifiers are used by partially sighted web users to increase the size of on-screen elements. The Topic Of Your Website The first thing you will have to deal building your website has nothing to do with the web design itself, it's me related to content writing but it must be defined and will effect the rest of your actions. So first of all you need to decide what the topic of your future website is. The 2 Most Common Web Site Mistakes When we review the sites of potential clients, there are 2 mistakes we see over and over. If you are having problems with your site, make sure these 2 problems aren't killing you. Improve Web Sales Figures Forever And Ever Amen! "How do I improve web site sales figures?" The CEO roared at the web developer. The web developer looked at his boss a little confused and mumbled something about it not being his core competence with him being a programmer and all. Business Website Building Do's and Don'ts First, using a lot of web graphics, flash, banners and pictures on your home page may make it look fancy or cool; but it will slow down the loading time extensively. And lets be real here, most people that look at your web page will leave if it doesn't load in 3 seconds or less. The Disability Discrimination Act (DDA) & Web Accessibility There's been widespread speculation about the new legislation being introduced under the DDA (Disability Discrimination Act), which will ensure that websites are accessible to blind and disabled users. Try to find specific information about it on the Internet and chances are you'll come up empty handed. ![]() |
home | site map |
© 2006 |