For anyone interested - or who would like to critique

.
My user control design:
<asp:HiddenField ID=hvVal runat=server />
<asp:LinkButton ID=lnkClick runat=server />
<table id=tblView runat=server class=ViewMenu cellpadding=0 cellspacing=0>
<tr id=thisRow runat=server>
</tr>
</table>
My user control code behind:
<ParseChildren(True)> _
Partial Class ucViewMenu
Inherits System.Web.UI.UserControl
Private _row As ITemplate
Private _selectedIndex As Int16 = -1
Private scriptName As String
Public Event ItemClick(ByVal sender As Object, ByVal e As System.EventArgs)
<PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(GetType(TemplateControl)), TemplateInstance(TemplateInstance.Single)> _
Public Property RowTemplate() As ITemplate
Get
Return _row
End Get
Set(ByVal value As ITemplate)
_row = value
End Set
End Property
Public Property SelectedIndex() As Int16
Get
Return _selectedIndex
End Get
Set(ByVal value As Int16)
_selectedIndex = value
SelectItem(value)
End Set
End Property
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
MyBase.OnInit(e)
' set & add "onclick" script for this user control
scriptName = lnkClick.ClientID + "_Click"
AddScript()
' dynamically create horizontal menu
Dim td As HtmlTableCell
Dim a As HtmlAnchor
Dim c, lc As Control
Dim i As Int16 = 0
If Not IsNothing(_row) Then
Dim ph As New PlaceHolder
_row.InstantiateIn(ph)
' each placeholder in this template indicates a table cell/column
' move placeholder controls into A element (which should be image & text)
While ph.Controls.Count > 0
c = ph.Controls(0)
If TypeOf c Is PlaceHolder Then
td = New HtmlTableCell
a = New HtmlAnchor
While c.Controls.Count > 0
lc = c.Controls(0)
a.Controls.Add(lc)
c.Controls.Remove(lc)
End While
a.HRef = "javascript:" + scriptName + "(" + i.ToString + ")"
td.Controls.Add(a)
thisRow.Controls.Add(td)
i += 1
End If
ph.Controls.Remove(c)
End While
' set all cells to same width
If thisRow.Cells.Count > 0 Then
Dim pct As Decimal = 100 / thisRow.Cells.Count
For Each cell As HtmlTableCell In thisRow.Cells
cell.Width = FormatNumber(pct, 0) + "%"
Next
End If
' select default cell
SelectItem(_selectedIndex)
End If
End Sub
Private Sub SelectItem(ByVal index As Int16)
_selectedIndex = index
If index < thisRow.Cells.Count Then
For i As Int16 = 0 To thisRow.Cells.Count - 1
If i = index Then
thisRow.Cells(i).BgColor = "#BAC3D6"
Else
thisRow.Cells(i).BgColor = String.Empty
End If
Next
End If
End Sub
Protected Sub lnkClick_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkClick.Click
' we run all clicks through a linkbutton on the actual form so that the update panel
' recognizes its "click" event as an async postback
Dim idx As Int16 = -1
Dim val As String = hvVal.Value
If IsNumeric(val) Then
idx = CInt(val)
End If
SelectItem(idx)
RaiseEvent ItemClick(Me, e)
End Sub
Private Sub AddScript()
Dim script As String
script = "function " + scriptName + "(val)" + _
"{ " + _
" $get('" + hvVal.ClientID + "').value = val;" + _
" $get('" + lnkClick.ClientID + "').click();" + _
" }"
Microsoft.Web.UI.ScriptManager.RegisterClientScriptBlock( _
Me, _
GetType(Page), _
scriptName, _
script, _
True)
End Sub
End Class
User control example:
<uc:ViewMenu ID=mnuView2 runat=server SelectedIndex=0>
<RowTemplate>
<asp:PlaceHolder ID="ph1" runat=server><asp:Image ID="img1" runat=server ImageUrl="~/images/card.gif" />Access</asp:PlaceHolder>
<asp:PlaceHolder ID="ph2" runat=server><asp:Image ID="img2" runat=server ImageUrl="~/images/debit.gif" />Debit</asp:PlaceHolder>
<asp:PlaceHolder ID="ph3" runat=server><asp:Image ID="img3" runat=server ImageUrl="~/images/mail.gif" />Address</asp:PlaceHolder>
<asp:PlaceHolder ID="ph4" runat=server><asp:Image ID="img4" runat=server ImageUrl="~/images/car.gif" />Vehicle</asp:PlaceHolder>
<asp:PlaceHolder ID="ph5" runat=server><asp:Image ID="img5" runat=server ImageUrl="~/images/contract.gif" />Contract</asp:PlaceHolder>
<asp:PlaceHolder ID="ph6" runat=server><asp:Image ID="img6" runat=server ImageUrl="~/images/other.gif" />Other</asp:PlaceHolder>
</RowTemplate>
</uc:ViewMenu>