C
Cuperman
Hi All,
Any ideas on how I could make the code below less verbose and more
scalable (more iterations are needed)...My thoughts are dynamically
named variables but I don't know how to do this (is it possible?)
VB.Net ideas preferred,
Many thanks,
Mark
=================================================
Select Case i
Case 1
Dim AttBtn1 As New ImageButton
With AttBtn1
.CssClass = "Att_Button " +
node.Attributes("type").Value
End With
e.Item.Cells("2").Controls.Add(AttBtn1)
Case 2
Dim AttBtn2 As New ImageButton
With AttBtn2
.CssClass = "Att_Button " +
node.Attributes("type").Value
End With
e.Item.Cells("2").Controls.Add(AttBtn2)
Case 3
Dim AttBtn3 As New ImageButton
With AttBtn3
.CssClass = "Att_Button " +
node.Attributes("type").Value
End With
e.Item.Cells("2").Controls.Add(AttBtn3)
'repeat ad infinitum
End Select
===================================================
Any ideas on how I could make the code below less verbose and more
scalable (more iterations are needed)...My thoughts are dynamically
named variables but I don't know how to do this (is it possible?)
VB.Net ideas preferred,
Many thanks,
Mark
=================================================
Select Case i
Case 1
Dim AttBtn1 As New ImageButton
With AttBtn1
.CssClass = "Att_Button " +
node.Attributes("type").Value
End With
e.Item.Cells("2").Controls.Add(AttBtn1)
Case 2
Dim AttBtn2 As New ImageButton
With AttBtn2
.CssClass = "Att_Button " +
node.Attributes("type").Value
End With
e.Item.Cells("2").Controls.Add(AttBtn2)
Case 3
Dim AttBtn3 As New ImageButton
With AttBtn3
.CssClass = "Att_Button " +
node.Attributes("type").Value
End With
e.Item.Cells("2").Controls.Add(AttBtn3)
'repeat ad infinitum
End Select
===================================================