how can i access to the WebControlls in a FormView's template?

G

Guest

i have several textBox and a popCalendar in a FormView ,i want to let users
select date through the popCalendar and then the textbox get the selected
datetime,my codes like this:
Protected Sub PopCalendar1_SelectionChanged(ByVal sender As Object,
ByVal e As System.EventArgs)
textBox1.text = popCalendar1.date
End Sub

but i got the msg as: Name 'textBox1' is not declared. Name 'popCalendar1'
is not declared.

how can i do ???
regards!
 
G

Guest

thanks for your reply.
i used the codes like below:
Dim tb1 As TextBox = FormView1.FindControl("textBox1")
Dim pc1 As RJS.Web.WebControl.PopCalendar =
FormView1.FindControl("popCalendar1")
tb1.Text =pc1.DateValue.ToString
it works! Is there any better way ?
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top