D
DrTeeth
I new to ASP.NET and got slightly confused on a probably simple little
issue.
I am try to iterate through some ASP radio buttons to see which of them is
checked.
But I get the error :
Unable to cast object of type 'System.Web.UI.LiteralControl' to type
'System.Web.UI.WebControls.RadioButton'.
The error occurs in the line : For Each rdbChecked In Me.Controls
Any help would be much appreciated. TIA
Protected Sub cmdSearch_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim rdbChecked As RadioButton
Dim sURL As String = ""
For Each rdbChecked In Me.Controls
If rdbChecked.Checked Then
sURL = GetSearchString(rdbChecked.ID) & txtSearch.Text
End If
Next
Response.Redirect(sURL)
End Sub
issue.
I am try to iterate through some ASP radio buttons to see which of them is
checked.
But I get the error :
Unable to cast object of type 'System.Web.UI.LiteralControl' to type
'System.Web.UI.WebControls.RadioButton'.
The error occurs in the line : For Each rdbChecked In Me.Controls
Any help would be much appreciated. TIA
Protected Sub cmdSearch_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim rdbChecked As RadioButton
Dim sURL As String = ""
For Each rdbChecked In Me.Controls
If rdbChecked.Checked Then
sURL = GetSearchString(rdbChecked.ID) & txtSearch.Text
End If
Next
Response.Redirect(sURL)
End Sub