No, the code gets all items that are numeric. If you use that to get
values from checkboxes, the code is very sensetive to changes.
The IsNumeric method is something that is left over from VB 6. There is
no corresponding method in C#. You can reference
Microsoft.VisualBasic.dll and use the IsNumeric method, but you should
really use an alternative method to identify the checkboxes.
Can't the checkboxes be identified using their name, or part of the name?
To verify that a string contains only digits, you can use a regular
expression:
If Regex.IsMatch(item, "^\d+$") Then
Vikas Kumar wrote:
For Each item In Request.Form
If IsNumeric(item) Then
Try
Approved(item)
Catch ex As Exception
Response.Write(ex.Message)
End Try
End If
Next
this is code in vb.net to get all items whose check boxes are checked
i want to make same in c# what will be corressponding code
i am not getting IsNumeric in C#
what will be corresponding keyword against it