The following code shows how to programmatically set meta content tag that instructs the client to wait ten seconds and then to go to the specified URL. Also, it will render the stylesheet tag attribute in this same method.
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
aspNet.Attributes("content") = "10;URL="
StyleSheet.Attributes["href"] = "style.css"
End Sub
</script>
<html>
<meta id="aspNet" runat="server" http-equiv="refresh"></meta>
<link id="StyleSheet" rel="stylesheet" type="text/css" runat="server"></link>
<body>
Content
</body>
</html>
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(object sender, EventArgs e)
{
aspNet.Attributes["content"] = @"10;URL=";
StyleSheet.Attributes["href"] = "style.css";
}
</script>
<html>
<meta id="aspNet" runat="server" http-equiv="refresh"></meta>
<link id="StyleSheet" rel="stylesheet" type="text/css" runat="server"></link>
<body>
Content
</body>
</html>
The resulting HTML tags are shown below.
<meta id="aspNet" http-equiv="refresh" content="4;URL="></meta>
<link id="StyleSheet" rel="stylesheet" type="text/css" runat="server" href="style.css"></link>
Notice the very important presence of the closing tag in the instance of the meta tag and stylesheet link tags.
You could even extend this functionality even further by creating and compiling a utility class that has all your common code such as page attributes, email addresses, and etc. This way, when a change is required, this one single class is the only piece of the application that will require changes in the case of changing an email address and any page stylesheet references as I used in my example above. This snippet should, however, give you an idea on how to consolidate common tags and attributes used within an application.