Imports System
Imports System.ComponentModel
Imports System.Web
Imports System.Web.UI
Namespace LozinskiWebScript
'################################
'#CLASS: PopcornTrailBasic.vb - Version 1.0
'#
'#INSTALLATION INSTRUCTIONS:
'# 1) Compile this VB .NET code and move the
'# resulting dll file into your web project's "bin" directory.
'# 2) In the aspx page you wish to have this control run,
'# add in the appropriate "Register" directive.
'# Example:
'# <%@ Register TagPrefix="Lozinski" Namespace="LozinskiPopcornTrailBasic.LozinskiWebScript" Assembly="LozinskiPopcornTrailBasic" %>
'# 3) Add the control's tag to your ASPX page wherever
'# you would like the popcorn trail to occur.
'#
'# Example tag below given the above "Register":
'#
'#
'#TO ADD THE CONTROL TO YOUR VISUAL STUDIO TOOLBOX:
'# 1) Select "File | New Project"
'# 2) Make sure "VB Class" is slected. Change the default name
'# to "PopcornTrailBasic.vb", select the location, and
'# select "close solution".
'# 3) Click "ok".
'# 3) Copy and paste this code into your new class file.
'# 4) Compile this file.
'# 5) Open up your web project with the aspx forms you would like
'# to have the popcorn trails on.
'# 6) Select "Project | Add Reference"
'# 7) Click the "browse" button. Find the location of the
'# LozinskiPopcornTrailBasic.dll file, select the file,
'# and click "ok".
'# 8) You should now see it in your "solution explorer".
'# 9) In the design view to any of your aspx web forms, right click
'# within your toolbox and select "add/remove items".
'# 10) Click "browse", select the LozinskiPopcornTrailBasic.dll
'# file, and click "ok".
'# 11) It should now be in your toolbox! Just drag and drop
'# like any other tool. Enjoy! :)
'#
'#REQUIREMENTS:
'# 1) Windows 2000 Server or later
'# 2) IIS 5.0 or later
'# 3) .NET Framework >= 1.1
'#
'#HISTORY:
'# 07/30/05 1.0 Original Release
'#
'#AUTHOR:
'# http://www.davelozinski.com/scripts
'#
'#UPGRADE TO THE ADVANCED VERSION:
'# http://www.davelozinski.com/scripts/popcorn_trail/
'#
'#ABOUT THIS CLASS FILE:
'# This VB class can be compiled and used as a "control"
'# when designing ASP .NET webforms, such as in
'# Visual Studio.
'#
'# The "Render" method generates a "popcorn" trail
'# on your web page.
'################################
Public Class PopcornTrailBasic : Inherits Control
Private trail() As String
Private path As String
Private x As Integer
Private UpperBound As Integer
Private Url As String
Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
Me.Url = HttpContext.Current.Request.ServerVariables("URL")
trail = Split(Me.Url, "/")
UpperBound = UBound(trail)
For x = 1 To (UBound(trail) - 1)
path = path & "/" & trail(x)
output.Write("-> " & trail(x) & " ")
Next
End Sub
End Class
End Namespace