This is in response to the URL you posted above:
http://www.reflectionit.nl/InitialFocus.aspx
I have been looking all over for a
VB version of that code and can't find it.
I have used a C# to
VB converter vut when running this code, I get an error that says:
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Line 41:
Line 42: ' Set Focus on the selected item of a RadioButtonList
Line 43: Dim rbl As RadioButtonList = control
Line 44: If Not (rbl Is Nothing) Then
Line 45: Dim suffix As String = "_0"
Here is that function in
VB.
' Set Focus on the selected item of a RadioButtonList
Dim rbl As RadioButtonList = control
If Not (rbl Is Nothing) Then
Dim suffix As String = "_0"
Dim t As Integer = 0
Dim li As ListItem
For Each li In rbl.Items
If li.Selected Then
suffix = "_" + t.ToString()
Exit For
End If
t += 1
Next li
s.Append(suffix)
End If