How do you populate a textbox that is in FormView?

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?
 
G

Guest

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 = ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top