How do you populate a textbox that is in FormView?

  • Thread starter Thread starter Ron H.
  • Start date Start date
R

Ron H.

I have a textbox named txtCityOfChoice1 that is located in a formview called
FormViewCities.


I want to be able to populate the txtCityOfChoice1 with the name of a city
that meets certain criteria. I've have tried so many ways and it doesn't
work.

txtCityOfChoice1.text = "Phoenix" (does not work) in fact in the <script>
segment of the page it does not even show up in the list pops up to select
the list of items from.

FormViewCities.txtCityOfChoice1.text = "Phoenix" (doesn't work either)


Can anyone please tell me what needs to be done to populate a textbox that
is in formview?
 
I have a textbox named txtCityOfChoice1 that is located in a formview called
FormViewCities.

I want to be able to populate the txtCityOfChoice1 with the name of a city
that meets certain criteria. I've have tried so many ways and it doesn't
work.

txtCityOfChoice1.text = "Phoenix" (does not work) in fact in the <script>
segment of the page it does not even show up in the list pops up to select
the list of items from.

FormViewCities.txtCityOfChoice1.text = "Phoenix" (doesn't work either)

Can anyone please tell me what needs to be done to populate a textbox that
is in formview?

Use FindControl method to find the textbox

Dim txtTest As TextBox = FormView1.FindControl("txtCityOfChoice1")
txtTest.Text = ...
 
Back
Top