My technique involves creating a master page ASP file which has all the common elements. Where ever I want content to be added I add a call to a sub routine.
Then in my content pages when I want the master page content to be added I include it at that point. I then create a sub routine for each content area and put my content inside these. You can have as many content sub routines as required but they must exist in every content page that uses that master page.
Any ASP variables that are needed by more than one content area should be created outside of the sub routines.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<% Call HeadPlaceHolder() %>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
Logo etc etc
<% Call ContentPlaceHolder() %>
Copyright etc etc
'Any ASP variables that are needed by multiple contenbt areas should be declared
'outside of the sub routines
'It's a good practice to keep your ASP script at the beginning of your pages anyway
<% Sub HeadPlaceHolder() %>
<title>My page title</title>
<meta content="My meta description" name="description" />
<% End Sub %>
<% Sub ContentPlaceHolder() %>
<p>My page content goes here</p>
<% End Sub %>
by John Avis | May 6, 2020
If you are having intermittent problems sending email in .NET using System.Net.Mail consider switching libraries.
by John Avis | November 4, 2019
As support ends for Microsoft Windows Server 2008 I have recently gone through migrating some websites to a new server running Windows Server 2016 and IIS 10 but some of the websites did not work.
by John Avis | October 15, 2019
For a website project I needed a way to enter multiple tags. I just wanted something simple that I could easily modify to suit my own needs, so I wrote my own.