NickMalloy
Programmer
How do you get data from dynamically created textboxes that are in a placeholder that resides in a content page controled by a master page. I recreate the textbox everytime the page loads. I used this same code in 1.1 and it worked fine, now it isn't.
Here is two ways I have tried
<code>
Dim a As TextBox
a = CType(Me.Page.FindControl("first12"), TextBox)
Dim mpContentPlaceHolder As ContentPlaceHolder
Dim mpTextBox As TextBox
mpContentPlaceHolder = _
CType(Master.FindControl("cp"), _
ContentPlaceHolder)
If Not mpContentPlaceHolder Is Nothing Then
mpTextBox = CType(mpContentPlaceHolder.Page.FindControl("first12"), _
TextBox)
If Not mpTextBox Is Nothing Then
mpTextBox.Text = "TextBox found!"
Else
Response.Write("Not Fount")
End If
End If
</code>
Here is two ways I have tried
<code>
Dim a As TextBox
a = CType(Me.Page.FindControl("first12"), TextBox)
Dim mpContentPlaceHolder As ContentPlaceHolder
Dim mpTextBox As TextBox
mpContentPlaceHolder = _
CType(Master.FindControl("cp"), _
ContentPlaceHolder)
If Not mpContentPlaceHolder Is Nothing Then
mpTextBox = CType(mpContentPlaceHolder.Page.FindControl("first12"), _
TextBox)
If Not mpTextBox Is Nothing Then
mpTextBox.Text = "TextBox found!"
Else
Response.Write("Not Fount")
End If
End If
</code>