Convert string to textbox

  • Thread starter Thread starter Steven K
  • Start date Start date
S

Steven K

Hello,

I am having trouble converting a string to a textbox object. I am getting
the following error:

Value of type 'String' cannot be converted to
'System.Web.UI.WebControls.TextBox'.


Dim objUpdate As New TextBox
Dim ctrFor As Integer = 1
Dim strForLoop1 As String = "tbxHandle0" & ctrFor
Dim strFrmObj As String = CType(strForLoop1, TextBox).Text

Thanks, Steven
 
Hello Steven,
Hello,

I am having trouble converting a string to a textbox object. I am
getting the following error:

This is to be expected. A string is not a TextBox.
Dim strFrmObj As String = CType(strForLoop1, TextBox).Text

How about:

Dim objTextBox As New TextBox()
objTextBox.Text = strForLoop1
 
Back
Top