Linking to an Include Code Library
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
lblMessage1.Text = MakeLength("www.", "java2s.com", 12)
lblMessage2.Text = SystemInfo()
End Sub
</SCRIPT>
<!-- #include file="CodeLibrary.inc" -->
<HTML>
<HEAD>
<TITLE>Linking to an Include Code Library</TITLE>
</HEAD>
<form runat="server">
<BR><BR>
<asp:label
id="lblMessage1"
runat="Server"
/>
<BR><BR>
<asp:label
id="lblMessage2"
runat="Server"
/>
<BR><BR>
</form>
</BODY>
</HTML>
<%--
<script runat=server>
Function MakeLength(StringToSize as String,PadCharacter as String, SizeToLength as Integer)
If Len(StringToSize) >= SizeToLength Then
MakeLength = Left(StringToSize, SizeToLength)
Else
MakeLength = StringToSize
Do Until Len(MakeLength) = SizeToLength
MakeLength = MakeLength & PadCharacter
Loop
End If
End Function
Public Function SystemInfo()
SystemInfo = "Machine Name: " & Server.MachineName _
& "<BR>Current Script Timeout: " _
& Server.ScriptTimeOut _
& " seconds<BR>Path to Page: " _
& Server.MapPath("") & "<BR>System Date/Time: " _
& Date.Now()
End Function
</script>
--%>
Related examples in the same category